/* Otter2 Chat Online — extracted from index1 #ttcChatV1; do not edit index.html */

/* ============================================================
   CHAT V1 — UI
   ============================================================ */

#ttcChatV1{
  --ttc-red:#d71920;
  --ttc-red2:#b51218;
  --ttc-bg:#f6f7f9;
  --ttc-card:#ffffff;
  --ttc-text:#202124;
  --ttc-muted:#6b7280;
  --ttc-border:#e5e7eb;

  position:fixed;
  inset:0;
  z-index:999999;
  display:none;
  background:rgba(0,0,0,.45);
  font-family:inherit;
}

#ttcChatV1.ttc-chat-open{
  display:block;
}

#ttcChatV1 .ttc-chat-shell{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  margin:0;
  touch-action:auto;
}

#ttcChatV1 .ttc-chat-head{
  cursor:grab;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
}

#ttcChatV1 .ttc-chat-head button,
#ttcChatV1 .ttc-chat-head input,
#ttcChatV1 .ttc-chat-head select{
  cursor:pointer;
}

#ttcChatV1 .ttc-chat-shell.ttc-chat-dragging{
  cursor:grabbing;
  transition:none !important;
}

#ttcChatV1 .ttc-chat-shell.ttc-chat-dragging .ttc-chat-head{
  cursor:grabbing;
}

#ttcChatV1 *{
  box-sizing:border-box;
}

.ttc-chat-shell{
  width:min(1100px,96vw);
  height:min(850px,94vh);
  background:var(--ttc-bg);
  border-radius:20px;
  overflow:hidden;
  box-shadow:0 20px 70px rgba(0,0,0,.28);
  display:flex;
  flex-direction:column;
}

.ttc-chat-head{
  background:#fff;
  border-bottom:1px solid var(--ttc-border);
  min-height:70px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
}

.ttc-chat-title{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.ttc-chat-title-icon{
  width:42px;
  height:42px;
  border-radius:13px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fff0f1;
  font-size:23px;
}

.ttc-chat-title-main{
  min-width:0;
}

.ttc-chat-title-main strong{
  display:block;
  font-size:17px;
  line-height:1.2;
}

.ttc-chat-room-name{
  color:var(--ttc-muted);
  font-size:13px;
  margin-top:3px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ttc-chat-head-actions{
  display:flex;
  align-items:center;
  gap:7px;
}

.ttc-chat-btn{
  border:1px solid var(--ttc-border);
  background:#fff;
  color:var(--ttc-text);
  border-radius:10px;
  min-height:38px;
  padding:0 11px;
  cursor:pointer;
  font:inherit;
  transition:.15s ease;
}

.ttc-chat-btn:hover{
  border-color:#cbd5e1;
  transform:translateY(-1px);
}

.ttc-chat-btn.ttc-primary{
  background:var(--ttc-red);
  color:#fff;
  border-color:var(--ttc-red);
}

.ttc-chat-close{
  font-size:20px;
  width:38px;
  padding:0;
}

.ttc-chat-body{
  flex:1;
  min-height:0;
  display:flex;
}

.ttc-chat-rooms{
  width:230px;
  flex:0 0 230px;
  background:#fff;
  border-right:1px solid var(--ttc-border);
  padding:12px;
  overflow:auto;
}

.ttc-chat-room-label{
  font-size:11px;
  font-weight:700;
  color:#9ca3af;
  letter-spacing:.05em;
  padding:4px 8px 9px;
}

.ttc-chat-room{
  width:100%;
  border:0;
  background:transparent;
  text-align:left;
  padding:10px 11px;
  border-radius:11px;
  cursor:pointer;
  font:inherit;
  color:var(--ttc-text);
  margin-bottom:3px;
}

.ttc-chat-room:hover{
  background:#f5f5f5;
}

.ttc-chat-room.active{
  background:#fff0f1;
  color:var(--ttc-red);
  font-weight:700;
}

.ttc-chat-room small{
  display:block;
  color:var(--ttc-muted);
  font-size:11px;
  margin-top:2px;
}

.ttc-chat-main{
  flex:1;
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.ttc-chat-online{
  min-height:40px;
  padding:8px 14px;
  background:#fff;
  border-bottom:1px solid var(--ttc-border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:var(--ttc-muted);
  font-size:12px;
}

.ttc-chat-online-left{
  display:flex;
  align-items:center;
  gap:6px;
}

.ttc-online-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#F7F8FA;
  box-shadow:0 0 0 3px #F97316;
}

.ttc-chat-messages{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:15px;
  scroll-behavior:smooth;
}

.ttc-chat-empty{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:var(--ttc-muted);
  padding:30px;
}

.ttc-chat-message{
  display:flex;
  gap:9px;
  margin-bottom:13px;
  align-items:flex-start;
}

.ttc-chat-message.mine{
  flex-direction:row-reverse;
}

.ttc-chat-avatar{
  width:34px;
  height:34px;
  flex:0 0 34px;
  border-radius:50%;
  background:#fff;
  border:1px solid var(--ttc-border);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
}

.ttc-chat-message-content{
  max-width:min(75%,680px);
  min-width:0;
}

.ttc-chat-message.mine .ttc-chat-message-content{
  text-align:right;
}

.ttc-chat-meta{
  display:flex;
  align-items:center;
  gap:7px;
  margin:0 3px 4px;
  font-size:11px;
  color:var(--ttc-muted);
}

.ttc-chat-message.mine .ttc-chat-meta{
  justify-content:flex-end;
}

.ttc-chat-name{
  font-weight:700;
  color:#4b5563;
}

.ttc-chat-bubble{
  display:inline-block;
  text-align:left;
  background:#fff;
  border:1px solid var(--ttc-border);
  border-radius:14px;
  padding:9px 11px;
  color:var(--ttc-text);
  white-space:pre-wrap;
  word-break:break-word;
  line-height:1.5;
}

.ttc-chat-message.mine .ttc-chat-bubble{
  background:#fff0f1;
  border-color:#ffd1d4;
}

.ttc-chat-reply{
  border-left:3px solid #cbd5e1;
  background:#f8fafc;
  padding:5px 8px;
  margin-bottom:7px;
  border-radius:6px;
  font-size:11px;
  color:#64748b;
}

.ttc-chat-file{
  margin-top:7px;
}

.ttc-chat-file img{
  max-width:min(360px,70vw);
  max-height:330px;
  border-radius:10px;
  display:block;
  cursor:pointer;
}

.ttc-chat-file-link{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:8px 10px;
  background:#f8fafc;
  border:1px solid var(--ttc-border);
  border-radius:9px;
  color:#374151;
  text-decoration:none;
  font-size:13px;
}

.ttc-chat-file-link:hover{
  background:#f1f5f9;
}

.ttc-chat-actions{
  display:flex;
  align-items:center;
  gap:4px;
  margin-top:5px;
  flex-wrap:wrap;
}

.ttc-chat-message.mine .ttc-chat-actions{
  justify-content:flex-end;
}

.ttc-reaction{
  border:1px solid transparent;
  background:transparent;
  border-radius:8px;
  padding:3px 6px;
  cursor:pointer;
  font-size:13px;
}

.ttc-reaction:hover{
  background:#fff;
  border-color:var(--ttc-border);
}

.ttc-reaction.active{
  background:#fff;
  border-color:#f3a3a8;
}

.ttc-reaction-count{
  font-size:10px;
  color:#6b7280;
  margin-left:2px;
}

.ttc-message-tool{
  border:0;
  background:transparent;
  color:#9ca3af;
  cursor:pointer;
  font-size:11px;
  padding:3px 5px;
}

.ttc-message-tool:hover{
  color:var(--ttc-red);
}

.ttc-chat-composer-wrap{
  background:#fff;
  border-top:1px solid var(--ttc-border);
  padding:9px 12px 74px;
}

.ttc-chat-replying{
  display:none;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background:#f8fafc;
  border:1px solid var(--ttc-border);
  border-radius:9px;
  padding:7px 9px;
  margin-bottom:7px;
  font-size:12px;
  color:#64748b;
}

.ttc-chat-replying.show{
  display:flex;
}

.ttc-chat-replying button{
  border:0;
  background:transparent;
  cursor:pointer;
  font-size:16px;
}

.ttc-chat-composer{
  display:flex;
  align-items:flex-end;
  gap:7px;
}

.ttc-chat-gif{
  margin-bottom:6px;
  padding:6px;
  border:1px solid var(--ttc-border);
  border-radius:12px;
  background:#fff;
}
#ttcChatGifPanel[hidden],
#ttcChatPreview[hidden]{
  display:none !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  height:0 !important;
  overflow:hidden !important;
}
#ttcChatGifPanel:not([hidden]){
  display:flex !important;
  flex-direction:column;
  position:absolute;
  left:0;
  right:0;
  bottom:100%;
  z-index:40;
  width:100%;
  max-height:min(72vh, 640px);
  height:auto !important;
  margin:0 0 8px !important;
  padding:10px !important;
  overflow:hidden !important;
  box-shadow:0 16px 40px rgba(0,0,0,.18);
}

.ttc-chat-gif-bar{
  display:flex;
  gap:6px;
  align-items:center;
}

.ttc-chat-gif-bar input{
  flex:1;
  min-width:0;
  border:1px solid var(--ttc-border);
  border-radius:8px;
  padding:7px 8px;
  font:inherit;
}

.ttc-chat-gif-bar button,
.ttc-chat-gif-results button{
  border:1px solid var(--ttc-border);
  background:#f8fafc;
  border-radius:8px;
  cursor:pointer;
  font-weight:700;
}

.ttc-chat-gif-bar button{
  padding:7px 8px !important;
  white-space:nowrap;
  color:#111827 !important;
  -webkit-text-fill-color:#111827 !important;
  background:#f8fafc !important;
}

.ttc-chat-gif-results{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(132px, 1fr));
  gap:8px;
  max-height:min(60vh, 540px);
  overflow:auto;
  margin-top:8px;
}

.ttc-chat-gif-results .ttc-gif-more{
  grid-column:1 / -1;
  width:100%;
  height:auto;
  min-height:40px;
  padding:6px 10px !important;
  color:#16283F !important;
  -webkit-text-fill-color:#16283F !important;
  background:#F7F8FA !important;
}
.ttc-chat-gif-results button{
  width:100%;
  height:132px;
  padding:0 !important;
  overflow:hidden;
}

.ttc-chat-gif-results img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.ttc-chat-preview{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:6px;
  padding:6px;
  border:1px solid var(--ttc-border);
  border-radius:12px;
  background:#f8fafc;
}

.ttc-chat-preview img{
  width:54px;
  height:54px;
  object-fit:cover;
  border-radius:8px;
}

.ttc-chat-preview button{
  margin-left:auto;
  border:0;
  background:transparent;
  font-size:18px;
  cursor:pointer;
}

.ttc-chat-message.pending{
  opacity:.72;
}

.ttc-chat-input{
  flex:1;
  min-width:0;
  max-height:130px;
  resize:none;
  border:1px solid var(--ttc-border);
  border-radius:12px;
  padding:10px 11px;
  outline:none;
  font:inherit;
  line-height:1.4;
  background:#fff;
}

.ttc-chat-input:focus{
  border-color:#f1a0a5;
  box-shadow:0 0 0 3px #fff0f1;
}

.ttc-chat-icon-btn{
  width:40px;
  height:40px;
  min-width:40px;
  flex:0 0 40px;
  padding:0 !important;
  border:1px solid var(--ttc-border);
  background:#fff !important;
  color:#111827 !important;
  -webkit-text-fill-color:#111827 !important;
  border-radius:10px;
  cursor:pointer;
  font-size:18px;
  line-height:1;
}

.ttc-chat-icon-btn:hover{
  background:#f8fafc !important;
}

#ttcChatGif{
  width:46px;
  min-width:46px;
  flex-basis:46px;
  font-size:13px;
  font-weight:800;
  letter-spacing:.2px;
  color:#16283F !important;
  -webkit-text-fill-color:#16283F !important;
  background:#F7F8FA !important;
}

.ttc-chat-send{
  background:#d71920 !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  border-color:#d71920 !important;
}

.ttc-chat-new{
  display:none;
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:82px;
  z-index:5;
  background:var(--ttc-red);
  color:#fff;
  border:0;
  border-radius:999px;
  padding:7px 13px;
  cursor:pointer;
  box-shadow:0 5px 18px rgba(215,25,32,.3);
  font:inherit;
  font-size:12px;
  font-weight:700;
}

.ttc-chat-new.show{
  display:block;
}

.ttc-chat-status{
  min-height:0;
  font-size:11px;
  color:var(--ttc-muted);
  padding:0 4px;
}
#ttcChatStatus:empty{
  display:none !important;
}

.ttc-chat-status.error{
  color:#dc2626;
}

.ttc-chat-status.ok{
  color:#16a34a;
}

.ttc-chat-login{
  padding:35px;
  text-align:center;
}

.ttc-chat-login strong{
  display:block;
  font-size:18px;
  margin-bottom:7px;
}

.ttc-chat-drop{
  display:none;
}

@media(max-width:720px){
  #ttcChatV1 .ttc-chat-shell{
    left:0 !important;
    top:0 !important;
    transform:none !important;
  }

  #ttcChatV1 .ttc-chat-head{
    cursor:default;
    touch-action:auto;
  }

  .ttc-chat-shell{
    width:100%;
    width:100dvw;
    max-width:100%;
    height:100%;
    height:100dvh;
    max-height:none;
    border-radius:0;
    left:0;right:0;top:0;bottom:0;
  }

  .ttc-chat-rooms{
    width:92px;
    flex-basis:92px;
    padding:8px 5px;
  }

  .ttc-chat-room{
    padding:9px 5px;
    text-align:center;
    font-size:12px;
  }

  .ttc-chat-room small{
    display:none;
  }

  .ttc-chat-room-label{
    text-align:center;
    padding-left:2px;
    padding-right:2px;
  }

  .ttc-chat-title-main strong{
    font-size:15px;
  }

  .ttc-chat-head{
    padding:9px;
  }

  .ttc-chat-message-content{
    max-width:82%;
  }

  .ttc-chat-messages{
    padding:11px 8px;
  }

  .ttc-chat-file img{
    max-width:65vw;
  }

  .ttc-chat-head-actions .ttc-chat-btn:not(.ttc-chat-close){
    display:none;
  }
}


/* index2: hide floating duplicate when nav Chat exists */
#ttcFloatingChatBtn{display:none !important;}
body.ttc-chat-open .otter2-nav{z-index:40;}


/* ============================================================
   😊 REACTION / ACTION BAR — ẩn mặc định, chỉ hiện khi nhấn giữ
   Bổ sung cho bản trích xuất: file CSS cũ bị THIẾU toàn bộ rule
   cho .ttc-reaction-picker / .ttc-reaction-summary /
   .ttc-message-selected, khiến 6 icon reaction + nút Trả lời /
   Xóa luôn hiện thường trực dưới mọi tin nhắn và thao tác
   chọn tin nhắn (class ttc-message-selected) không có tác dụng.
   ============================================================ */

.ttc-chat-message-content{
  position:relative;
}

/* Hàng badge reaction đã có người thả — chỉ hiện khi tin có reaction */
.ttc-chat-actions{
  margin-top:0;
}

.ttc-reaction-summary{
  display:flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;
  margin-top:5px;
}

.ttc-reaction-summary:empty{
  display:none;
}

.ttc-chat-message.mine .ttc-reaction-summary{
  justify-content:flex-end;
}

.ttc-reaction{
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
}

.ttc-reaction-summary .ttc-reaction{
  background:#fff;
  border:1px solid var(--ttc-border);
  border-radius:999px;
  padding:1px 7px;
  font-size:12px;
  line-height:1.55;
  box-shadow:0 1px 2px rgba(16,24,40,.06);
}

.ttc-reaction-summary .ttc-reaction:hover{
  background:#f8fafc;
}

.ttc-reaction-summary .ttc-reaction.active{
  background:#ffe9ea;
  border-color:#f3a3a8;
}

/* Thanh công cụ nổi: display:none cho đến khi tin nhắn được
   chọn bằng nhấn giữ (class ttc-message-selected) */
.ttc-action-bar{
  display:none;
  position:absolute;
  left:0;
  bottom:calc(100% + 4px);
  z-index:30;
  align-items:center;
  gap:2px;
  max-width:min(92vw,430px);
  background:#fff;
  border:1px solid var(--ttc-border);
  border-radius:999px;
  padding:4px 6px;
  box-shadow:0 10px 28px rgba(16,24,40,.18),0 2px 6px rgba(16,24,40,.10);
}

.ttc-chat-message.mine .ttc-action-bar{
  left:auto;
  right:0;
}

/* Tin nhắn sát mép trên khung chat → thanh lật xuống dưới */
.ttc-chat-message.ttc-bar-below .ttc-action-bar{
  bottom:auto;
  top:calc(100% + 4px);
}

.ttc-chat-message.ttc-message-selected .ttc-action-bar{
  display:flex;
  animation:ttc-bar-in .18s ease-out;
}

@keyframes ttc-bar-in{
  from{
    opacity:0;
    transform:translateY(4px) scale(.92);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

/* 6 reaction trong thanh: emoji lớn, nảy lần lượt kiểu Messenger */
.ttc-reaction-picker{
  display:flex;
  align-items:center;
  gap:1px;
}

.ttc-action-bar .ttc-reaction{
  font-size:21px;
  line-height:1.15;
  padding:4px 5px;
  border:0;
  border-radius:999px;
  background:transparent;
  transition:transform .12s ease,background .12s ease;
  animation:ttc-emoji-pop .3s cubic-bezier(.34,1.56,.64,1) backwards;
}

.ttc-action-bar .ttc-reaction:nth-child(1){ animation-delay:.00s; }
.ttc-action-bar .ttc-reaction:nth-child(2){ animation-delay:.03s; }
.ttc-action-bar .ttc-reaction:nth-child(3){ animation-delay:.06s; }
.ttc-action-bar .ttc-reaction:nth-child(4){ animation-delay:.09s; }
.ttc-action-bar .ttc-reaction:nth-child(5){ animation-delay:.12s; }
.ttc-action-bar .ttc-reaction:nth-child(6){ animation-delay:.15s; }

.ttc-action-bar .ttc-reaction:hover{
  background:#f3f4f6;
  transform:scale(1.3) translateY(-2px);
}

.ttc-action-bar .ttc-reaction.active{
  background:#ffe9ea;
}

@keyframes ttc-emoji-pop{
  from{
    opacity:0;
    transform:translateY(9px) scale(.35);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

/* Nút Trả lời / Xóa bên trong thanh nổi */
.ttc-action-bar .ttc-message-tool{
  font-size:12px;
  color:#4b5563;
  background:#f8fafc;
  border:1px solid var(--ttc-border);
  border-radius:999px;
  padding:5px 9px;
  margin-left:4px;
  white-space:nowrap;
}

.ttc-action-bar .ttc-message-tool:hover{
  color:var(--ttc-red);
  background:#fff;
}

/* Phản hồi thị giác khi đang nhấn giữ / tin đang được chọn */
.ttc-chat-bubble{
  -webkit-touch-callout:none;
  transition:transform .12s ease,filter .12s ease;
}

.ttc-chat-message.ttc-pressing .ttc-chat-bubble{
  filter:brightness(.96);
  transform:scale(.985);
}

.ttc-chat-message.ttc-message-selected .ttc-chat-bubble{
  border-color:#f3a3a8;
  box-shadow:0 4px 14px rgba(215,25,32,.10);
}

@media (prefers-reduced-motion:reduce){

  .ttc-chat-message.ttc-message-selected .ttc-action-bar,
  .ttc-action-bar .ttc-reaction{
    animation:none;
  }

}
