/* =========================================================
   CHAT – adaptado ao CSS de referência anexado
   Mantém os IDs/markup atuais do widget, mas segue o look do template
   ========================================================= */

#cos-chat-bubble{
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  top: auto !important;
  left: auto !important;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 1px solid var(--stroke, rgba(255,255,255,.12));
  background: rgba(255,255,255,.04);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: transform .15s ease, background .15s ease;
  z-index: 2147483645 !important;
  overflow: visible;
}
#cos-chat-bubble:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.07);
}

#cos-chat-bubble .cos-notify-dot{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--brand, #e50914);
  color: #fff;
  border: 2px solid rgba(12,12,12,.92);
  box-shadow: 0 10px 18px rgba(0,0,0,.35);
  z-index: 10;
}
#cos-chat-bubble.cos-has-new .cos-notify-dot,
#cos-chat-bubble .cos-notify-dot.is-visible{
  display: inline-flex;
  animation: cosBadgePulse 1.8s infinite;
}
@keyframes cosBadgePulse{
  0%   { box-shadow: 0 0 0 0 rgba(229,9,20,.45), 0 10px 18px rgba(0,0,0,.35); }
  70%  { box-shadow: 0 0 0 10px rgba(229,9,20,0), 0 10px 18px rgba(0,0,0,.35); }
  100% { box-shadow: 0 0 0 0 rgba(229,9,20,0), 0 10px 18px rgba(0,0,0,.35); }
}

#cos-chat-panel{
  position: fixed !important;
  right: 20px !important;
  bottom: 90px !important;
  width: min(420px, 92vw);
  height: auto;
  max-height: 520px;
  display: none;
  flex-direction: column;
  background: rgba(12,12,12,.96);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  overflow: hidden;
  z-index: 2147483646 !important;
}

#cos-chat-header{
  background: transparent;
  color: #fff;
  padding: 12px;
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.cos-chat-title{
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .2px;
}
#cos-chat-close,
#cos-login-link,
#cos-logout-link,
#cos-send,
#cos-image-remove,
.cos-like-btn,
.cos-message-image-btn{
  appearance:none;
  cursor:pointer;
}
#cos-chat-close,
#cos-login-link,
#cos-logout-link,
#cos-send,
#cos-image-remove{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  border-radius: 14px;
  box-shadow: 0 10px 18px rgba(0,0,0,.35);
  transition: transform .15s ease, background .15s ease, border .15s ease;
}
#cos-chat-close{
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items:center;
  justify-content:center;
  padding: 0;
}
#cos-chat-close:hover,
#cos-login-link:hover,
#cos-logout-link:hover,
#cos-send:hover,
#cos-image-remove:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
}
#cos-login-link,
#cos-logout-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}
#cos-chat-entry{
  background: transparent;
  padding: 12px;
}
#cos-chat-body{
  display:none;
  flex-direction: column;
  height: 420px;
}
#cos-chat-messages{
  flex: 1;
  min-height: 0;
  background: transparent;
  padding: 12px;
  overflow-y: auto;
}
#cos-chat-messages::-webkit-scrollbar{ width: 6px; }
#cos-chat-messages::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.22);
  border-radius: 3px;
}

#cos-chat-input{
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 10px;
  background: rgba(12,12,12,.96);
  border-top: 1px solid rgba(255,255,255,.10);
}
#cos-message{
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: #fff;
  padding: 12px;
  outline:none;
  font-size: 14px;
  border-radius: 14px;
}
#cos-message::placeholder{
  color: rgba(231,231,231,.55);
}
#cos-send{
  padding: 0 16px;
  height: 44px;
}

.cos-image-btn{
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(0,0,0,.35);
  transition: transform .15s ease, background .15s ease;
}
.cos-image-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
}

#cos-image-preview{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 10px;
  background: rgba(12,12,12,.96);
}
#cos-image-preview-tag{
  max-width: 120px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
}
#cos-image-remove{
  border-color: rgba(229,9,20,.25);
  background: rgba(229,9,20,.18);
  color: #fff;
  padding: 8px 10px;
}
#cos-image-remove:hover{
  background: rgba(229,9,20,.24);
}

.cos-message{
  position: relative;
  max-width: 86%;
  margin: 0 0 10px;
  padding: 10px 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.88);
  transition: transform .12s ease, background .12s ease, border .12s ease;
}
.cos-message:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
}
.cos-message.is-me{
  margin-left: auto;
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.95);
}
.cos-message.is-admin{
  border-color: rgba(229,9,20,.25);
  background: rgba(229,9,20,.10);
  color: rgba(255,255,255,.95);
  box-shadow: 0 12px 24px rgba(229,9,20,.08);
}
.cos-message.is-admin .cos-message-author{
  color: rgba(255,255,255,.98);
  font-weight: 800;
}
.cos-message-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 11px;
  opacity: .92;
}
.cos-message-author{
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.92);
}
.cos-message-time{
  margin-left: auto;
  font-size: 11px;
  opacity: .8;
}
.cos-admin-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: .6px;
  text-transform: uppercase;
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.14);
}
.cos-message-text{
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
  white-space: normal;
}
.cos-message-image-btn{
  display:block;
  background:none;
  border:0;
  padding:0;
  margin-top:10px;
}
.cos-message-image-btn img{
  display:block;
  max-width: 220px;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .15s ease;
}
.cos-message-image-btn img:hover{
  transform: scale(1.03);
}

.cos-message-actions{
  margin-top: 10px;
  display:flex;
  justify-content:flex-end;
}
.cos-like-btn{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,.82);
  border-radius: 999px;
  padding-right: 5px;
}
.cos-like-btn:hover,
.cos-like-btn.is-liked{
  color: rgba(255,255,255,.95);
  background: rgba(255,255,255,.14);
}
.cos-message-actions {
  opacity: 0;
  transition: 0.2s;
}

.cos-message:hover .cos-message-actions {
  opacity: 1;
}
#cos-image-modal[hidden]{display:none}
#cos-image-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
}
#cos-image-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}
#cos-image-dialog {
  position: relative;
  z-index: 2;
  width: min(96vw, 980px);
  height: min(92vh, 820px);
  margin: auto;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
}
#cos-image-frame-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#cos-image-modal-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
}
#cos-image-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
#cos-image-close:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.06);
}
#cos-image-close:active {
  transform: scale(.95);
}

@media (max-width: 768px) {
  #cos-chat-panel{
    right: 12px !important;
    left: 12px !important;
    bottom: 86px !important;
    width: auto;
    max-height: min(72vh, 640px);
  }

  #cos-chat-bubble{
    right: 16px !important;
    bottom: 16px !important;
  }

  .cos-message{
    max-width: 92%;
  }

  #cos-image-dialog {
    width: min(100vw - 16px, 980px);
    height: min(100vh - 16px, 900px);
    padding: 12px;
    border-radius: 14px;
  }

  #cos-image-close {
    width: 46px;
    height: 46px;
    top: 8px;
    right: 8px;
    font-size: 20px;
    border-radius: 16px;
  }
}

.cos-message-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
}

.cos-like-btn,
.cos-reply-btn {
  cursor: pointer;
  color: #9ca3af;
  transition: 0.2s;
  user-select: none;
}

.cos-like-btn:hover,
.cos-reply-btn:hover {
  color: #fff;
}

.cos-like-btn.is-liked {
  color: #22c55e;
}

.cos-like-count {
  margin-left: 3px;
}

.cos-action-separator {
  color: #555;
  margin: 0 2px;
}

