/* vAvtobyse 2.9.19 — mobile chat-list + heads-up notification hardening
   Fixes two live issues without changing message/call logic:
   1) bus-past chat list falling back to legacy white mobile CSS;
   2) foreground notification icon exploding when an old cached notification stylesheet is served. */

/* Main mobile chat list: the legacy responsive block still contains background:#fff!important.
   This selector intentionally outranks it only for the default bus-past theme. */
html.vav-mobile-layout[data-theme="bus-past"] body.vav-shell-mode .contacts-window,
html.vav-mobile-layout[data-theme="bus-past"] body.vav-shell-mode #conversationList,
html.vav-mobile-layout[data-theme="bus-past"] body.vav-shell-mode .conversation-list {
  background: #2b3439 !important;
  color: #f5f1e8 !important;
}

html.vav-mobile-layout[data-theme="bus-past"] body.vav-shell-mode #conversationList .conversation-item {
  background: #343e43 !important;
  color: #f5f1e8 !important;
  border: 1px solid #465158 !important;
  border-radius: 12px !important;
  margin: 4px 6px !important;
  width: calc(100% - 12px) !important;
}
html.vav-mobile-layout[data-theme="bus-past"] body.vav-shell-mode #conversationList .conversation-item:hover,
html.vav-mobile-layout[data-theme="bus-past"] body.vav-shell-mode #conversationList .conversation-item:active {
  background: #3d474c !important;
  border-color: #5b666b !important;
}
html.vav-mobile-layout[data-theme="bus-past"] body.vav-shell-mode #conversationList .conversation-item.selected {
  background: linear-gradient(90deg, #55492f, #384146) !important;
  border-color: #a4863c !important;
  box-shadow: inset 3px 0 0 #e3b84b !important;
}
html.vav-mobile-layout[data-theme="bus-past"] body.vav-shell-mode #conversationList .conversation-title {
  color: #f5f1e8 !important;
}
html.vav-mobile-layout[data-theme="bus-past"] body.vav-shell-mode #conversationList .conversation-preview,
html.vav-mobile-layout[data-theme="bus-past"] body.vav-shell-mode #conversationList .conversation-list-time {
  color: #bcb7ad !important;
}

/* Foreground heads-up: keep it messenger-sized even if a stale cached CSS rule slips through. */
.modern-notify-heads-root {
  width: min(520px, calc(100vw - 18px)) !important;
  max-width: calc(100vw - 18px) !important;
  pointer-events: none !important;
}
.modern-notify-heads-card {
  width: 100% !important;
  min-height: 58px !important;
  max-height: 76px !important;
  grid-template-columns: 40px minmax(0, 1fr) !important;
  grid-auto-rows: minmax(0, auto) !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 11px !important;
  overflow: hidden !important;
  border-radius: 14px !important;
  box-sizing: border-box !important;
}
.modern-notify-heads-icon {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  border-radius: 11px !important;
}
.modern-notify-heads-icon img,
.modern-notify-heads-card.type-message .modern-notify-heads-icon img,
.modern-notify-heads-card:not([class*="type-"]) .modern-notify-heads-icon img {
  display: block !important;
  position: static !important;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  transform: none !important;
  border-radius: 8px !important;
}
.modern-notify-heads-copy {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  display: grid !important;
  gap: 2px !important;
}
.modern-notify-heads-copy strong,
.modern-notify-heads-copy small {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.modern-notify-heads-copy strong { font-size: 14px !important; line-height: 18px !important; }
.modern-notify-heads-copy small { font-size: 12px !important; line-height: 16px !important; }

@media (max-width: 640px) {
  .modern-notify-heads-root {
    top: calc(env(safe-area-inset-top, 0px) + 6px) !important;
    width: calc(100vw - 14px) !important;
    max-width: calc(100vw - 14px) !important;
  }
  .modern-notify-heads-card {
    min-height: 56px !important;
    max-height: 70px !important;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    padding: 8px 10px !important;
  }
  .modern-notify-heads-icon {
    width: 38px !important; min-width: 38px !important; max-width: 38px !important;
    height: 38px !important; min-height: 38px !important; max-height: 38px !important;
  }
  .modern-notify-heads-icon img,
  .modern-notify-heads-card.type-message .modern-notify-heads-icon img,
  .modern-notify-heads-card:not([class*="type-"]) .modern-notify-heads-icon img {
    width: 28px !important; min-width: 28px !important; max-width: 28px !important;
    height: 28px !important; min-height: 28px !important; max-height: 28px !important;
  }
}
