/* Napisto v49.03 - isolated clean chat styles.
   This file is loaded after style.css and is the only authoritative layer
   for the front-end private chat thread. Older .np-message-bubble rules in
   style.css are considered legacy fallback and should not style the current
   .np-thread-* markup. */

.np-messages-shell--v489 .np-messages-layout--modern{
  align-items:start;
}

.np-messages-shell--v489 .np-messages-main{
  display:flex!important;
  flex-direction:column!important;
  gap:14px!important;
  min-width:0!important;
}

.np-messages-shell--v489 .np-messages-head--actions{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  min-width:0!important;
}

.np-messages-shell--v489 .np-message-chat-user{
  min-width:0!important;
}

.np-messages-shell--v489 .np-message-delete-conversation{
  flex:0 0 auto!important;
  margin:0!important;
}

.np-messages-shell--v489 .np-chat-thread[data-np-messages-list],
.np-messages-shell--v489 .np-messages-list[data-np-messages-list]{
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:12px!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-height:none!important;
  height:auto!important;
  overflow:visible!important;
  padding:14px!important;
  border-radius:24px!important;
  background:linear-gradient(180deg,rgba(244,239,255,.42),rgba(255,255,255,.80))!important;
  border:1px solid rgba(98,72,158,.12)!important;
  scroll-behavior:auto!important;
}

.np-messages-shell--v489 .np-chat-thread[data-np-messages-list]::-webkit-scrollbar,
.np-messages-shell--v489 .np-messages-list[data-np-messages-list]::-webkit-scrollbar{
  display:none!important;
}

.np-messages-shell--v489 .np-thread-row{
  box-sizing:border-box!important;
  display:flex!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  float:none!important;
  clear:both!important;
  position:relative!important;
}

.np-messages-shell--v489 .np-thread-row--other{justify-content:flex-start!important;}
.np-messages-shell--v489 .np-thread-row--own{justify-content:flex-end!important;}

.np-messages-shell--v489 .np-thread-bubble{
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  gap:8px!important;
  width:auto!important;
  min-width:min(260px,100%)!important;
  max-width:min(72%,680px)!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:13px 15px!important;
  border-radius:22px!important;
  overflow:visible!important;
  position:relative!important;
  transform:none!important;
  opacity:1!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:anywhere!important;
  line-height:1.45!important;
  box-shadow:0 12px 30px rgba(34,22,58,.08)!important;
}

.np-messages-shell--v489 .np-thread-bubble--other{
  align-self:flex-start!important;
  margin-right:auto!important;
  background:#fff!important;
  color:#211937!important;
  border:1px solid rgba(98,72,158,.14)!important;
}

.np-messages-shell--v489 .np-thread-bubble--own{
  align-self:flex-end!important;
  margin-left:auto!important;
  background:#6d51bb!important;
  background-image:linear-gradient(135deg,#5e4696,#8064cb)!important;
  color:#fff!important;
  border:1px solid rgba(255,255,255,.18)!important;
  box-shadow:0 14px 34px rgba(94,70,150,.22)!important;
}

.np-messages-shell--v489 .np-thread-bubble__head{
  box-sizing:border-box!important;
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:inherit!important;
  overflow:visible!important;
  position:static!important;
}

.np-messages-shell--v489 .np-thread-bubble__meta{
  box-sizing:border-box!important;
  display:block!important;
  flex:1 1 auto!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  color:inherit!important;
  font-size:.84rem!important;
  font-weight:900!important;
  line-height:1.25!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  opacity:.92!important;
}

.np-messages-shell--v489 .np-thread-bubble__delete,
.np-messages-shell--v489 .np-message-delete-form{
  box-sizing:border-box!important;
  display:block!important;
  flex:0 0 auto!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  line-height:1!important;
}

.np-messages-shell--v489 .np-thread-bubble__delete-button,
.np-messages-shell--v489 .np-message-delete-button{
  appearance:none!important;
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:auto!important;
  min-width:0!important;
  min-height:24px!important;
  height:auto!important;
  margin:0!important;
  padding:5px 10px!important;
  border:0!important;
  border-radius:999px!important;
  font-size:.72rem!important;
  font-weight:900!important;
  line-height:1!important;
  white-space:nowrap!important;
  text-decoration:none!important;
  box-shadow:none!important;
  cursor:pointer!important;
}

.np-messages-shell--v489 .np-thread-bubble--other .np-thread-bubble__delete-button,
.np-messages-shell--v489 article.np-message-bubble:not(.is-own) .np-message-delete-button{
  background:rgba(127,29,29,.08)!important;
  color:#9b1c1c!important;
}

.np-messages-shell--v489 .np-thread-bubble--own .np-thread-bubble__delete-button,
.np-messages-shell--v489 article.np-message-bubble.is-own .np-message-delete-button{
  background:rgba(255,255,255,.20)!important;
  color:#fff!important;
}

.np-messages-shell--v489 .np-thread-bubble__text{
  box-sizing:border-box!important;
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:inherit!important;
  font-size:1.02rem!important;
  font-weight:650!important;
  line-height:1.5!important;
  white-space:pre-wrap!important;
  overflow:visible!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  text-align:left!important;
  opacity:1!important;
  position:static!important;
}

.np-messages-shell--v489 .np-thread-bubble .np-message-media{
  box-sizing:border-box!important;
  display:block!important;
  width:100%!important;
  max-width:min(100%,520px)!important;
  margin:4px 0 0!important;
  padding:0!important;
  border-radius:16px!important;
  overflow:hidden!important;
  background:rgba(255,255,255,.14)!important;
}

.np-messages-shell--v489 .np-thread-bubble .np-message-media img,
.np-messages-shell--v489 .np-thread-bubble .np-message-media video{
  display:block!important;
  max-width:100%!important;
  height:auto!important;
  border-radius:16px!important;
}

.np-messages-shell--v489 .np-message-compose{
  position:relative!important;
  z-index:1!important;
  margin-top:10px!important;
}

.np-messages-shell--v489 .np-message-compose textarea{
  width:100%!important;
  min-width:0!important;
  line-height:1.45!important;
}

/* Legacy fallback: only for temporarily cached old AJAX/HTML. */
.np-messages-shell--v489 .np-chat-thread[data-np-messages-list] > article.np-message-bubble,
.np-messages-shell--v489 .np-messages-list[data-np-messages-list] > article.np-message-bubble{
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:8px!important;
  width:auto!important;
  min-width:min(260px,100%)!important;
  max-width:min(72%,680px)!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:13px 15px!important;
  border-radius:22px!important;
  overflow:visible!important;
  position:relative!important;
  float:none!important;
  clear:both!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  line-height:1.45!important;
  opacity:1!important;
  transform:none!important;
}

.np-messages-shell--v489 .np-chat-thread[data-np-messages-list] > article.np-message-bubble:not(.is-own),
.np-messages-shell--v489 .np-messages-list[data-np-messages-list] > article.np-message-bubble:not(.is-own){
  align-self:flex-start!important;
  margin-right:auto!important;
  background:#fff!important;
  color:#211937!important;
  border:1px solid rgba(98,72,158,.14)!important;
  box-shadow:0 10px 26px rgba(34,22,58,.07)!important;
}

.np-messages-shell--v489 .np-chat-thread[data-np-messages-list] > article.np-message-bubble.is-own,
.np-messages-shell--v489 .np-messages-list[data-np-messages-list] > article.np-message-bubble.is-own{
  align-self:flex-end!important;
  margin-left:auto!important;
  background:#6d51bb!important;
  background-image:linear-gradient(135deg,#5e4696,#8064cb)!important;
  color:#fff!important;
  border:1px solid rgba(255,255,255,.18)!important;
  box-shadow:0 12px 28px rgba(94,70,150,.22)!important;
}

.np-messages-shell--v489 article.np-message-bubble > .np-message-bubble__meta,
.np-messages-shell--v489 article.np-message-bubble > .np-message-bubble__body{
  box-sizing:border-box!important;
  background:transparent!important;
  color:inherit!important;
  border:0!important;
  box-shadow:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  overflow:visible!important;
  position:static!important;
}

.np-messages-shell--v489 article.np-message-bubble > .np-message-bubble__meta{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  width:100%!important;
  padding:0!important;
  opacity:.92!important;
}

.np-messages-shell--v489 article.np-message-bubble > .np-message-bubble__body{
  display:block!important;
  width:100%!important;
  padding:0!important;
  font-size:1.02rem!important;
  font-weight:650!important;
  line-height:1.5!important;
  white-space:pre-wrap!important;
  overflow-wrap:anywhere!important;
}

@media (max-width:980px){
  .np-messages-shell--v489 .np-messages-head--actions{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    align-items:start!important;
  }
  .np-messages-shell--v489 .np-message-delete-conversation,
  .np-messages-shell--v489 .np-message-delete-conversation__button{
    width:100%!important;
  }
}

@media (max-width:760px){
  .np-messages-shell--v489 .np-chat-thread[data-np-messages-list],
  .np-messages-shell--v489 .np-messages-list[data-np-messages-list]{
    gap:12px!important;
    padding:10px!important;
    max-height:none!important;
    height:auto!important;
    overflow:visible!important;
  }
  .np-messages-shell--v489 .np-thread-bubble,
  .np-messages-shell--v489 .np-chat-thread[data-np-messages-list] > article.np-message-bubble,
  .np-messages-shell--v489 .np-messages-list[data-np-messages-list] > article.np-message-bubble{
    max-width:94%!important;
    min-width:min(230px,100%)!important;
    padding:12px 13px!important;
    border-radius:20px!important;
  }
  .np-messages-shell--v489 .np-thread-bubble__head,
  .np-messages-shell--v489 article.np-message-bubble > .np-message-bubble__meta{
    align-items:flex-start!important;
  }
  .np-messages-shell--v489 .np-thread-bubble__meta,
  .np-messages-shell--v489 article.np-message-bubble > .np-message-bubble__meta > span{
    font-size:.78rem!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
  }
  .np-messages-shell--v489 .np-thread-bubble__text,
  .np-messages-shell--v489 article.np-message-bubble > .np-message-bubble__body{
    font-size:1rem!important;
    line-height:1.5!important;
  }
  .np-messages-shell--v489 .np-message-compose{
    margin-top:8px!important;
    bottom:auto!important;
    box-shadow:0 10px 28px rgba(34,22,58,.10)!important;
  }
  .np-messages-shell--v489 .np-message-compose textarea{
    min-height:52px!important;
    max-height:150px!important;
    font-size:1rem!important;
  }
}

@media (max-width:430px){
  .np-messages-shell--v489 .np-thread-bubble,
  .np-messages-shell--v489 .np-chat-thread[data-np-messages-list] > article.np-message-bubble,
  .np-messages-shell--v489 .np-messages-list[data-np-messages-list] > article.np-message-bubble{
    max-width:100%!important;
    min-width:0!important;
  }
}
