
.contactPage{padding:12px 0 0;}
.contactTabs{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:0 0 12px;border-top:none;}
.contactTabs__btn{height:38px;border:1.5px solid rgba(0,0,0,.12);border-radius:19px;background:#fff;color:#111;font-size:18px;font-weight:588;line-height:1;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.contactTabs__btn.is-active{border-color:rgba(255,47,109,.45);background:rgba(255,47,109,.08);color:#dd4a7d;}
.contactPanel{padding-bottom:8px;}
.contactContactsHead{padding:2px 0 8px;border-top:1px solid rgba(0,0,0,.06);}
.contactContactsTitle{padding:18px 8px 14px;font-size:18px;font-weight:588;line-height:1.3;color:#111;}
.contactSearchWrap{position:relative;padding:2px 12px 8px;margin:0 -12px 0;background:transparent; /* SP v194: ô tìm kiếm danh bạ dùng đúng mẫu ô tìm kiếm trang chủ */}
.contactSearchInput{width:100%;height:38px;border:1.5px solid rgba(0,0,0,.12);border-radius:999px;background:#fff;padding:0 18px;color:#000;font-size:14px;font-weight:400;outline:none;box-shadow:0 1px 4px rgba(0,0,0,.04);-webkit-appearance:none;appearance:none;}
.contactSearchInput:focus{border-color:#ef5da8;box-shadow:none;}
.contactSearchInput::placeholder{color:rgba(0,0,0,.52);font-weight:400;}
.contactList{display:flex;flex-direction:column;gap:2px;}
.contactListItem{appearance:none;-webkit-appearance:none;display:flex;align-items:center;gap:16px;width:100%;padding:18px 8px;background:#fff;text-align:left;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.contactListItem__avatar,.contactChatSheet__avatar{width:64px;height:64px;border-radius:999px;background:rgba(255,47,109,.08);display:flex;align-items:center;justify-content:center;color:#dd4a7d;font-size:18px;font-weight:588;flex:none;}
.contactListItem__body{min-width:0;display:flex;flex-direction:column;gap:7px;flex:1;}
.contactListItem__name{font-size:18px;font-weight:588;line-height:1.2;color:#111;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.contactListItem__text{font-size:16px;font-weight:400;line-height:1.35;color:#111;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.contactListItem__meta{align-self:flex-start;margin-left:auto;padding-top:2px;font-size:12px;line-height:1.2;color:rgba(0,0,0,.42);display:flex;flex-direction:column;align-items:flex-end;gap:6px;}
.contactListItem__time{display:block;}
.contactListItem__unread{min-width:18px;height:18px;padding:0 5px;border:1.5px solid #ff2f6d;border-radius:999px;background:#ff2f6d;color:#fff;font-size:11px;font-weight:588;line-height:15px;display:inline-flex;align-items:center;justify-content:center;}
.contactEmpty{padding:28px 8px;font-size:16px;font-weight:400;line-height:1.4;color:rgba(0,0,0,.5);}
.contactChatSheet{position:fixed;inset:0;z-index:1300;background:#fff;display:flex;flex-direction:column;height:100dvh;overflow:hidden;overscroll-behavior:contain;}
.contactChatSheet[hidden]{display:none !important;}
.contactChatSheet.contactChatSheet--parked{display:none !important;}
.contactChatSheet__bar{position:relative;z-index:2;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:calc(10px + env(safe-area-inset-top)) 14px 10px;background:rgba(255,255,255,.98);border-bottom:1px solid rgba(0,0,0,.08);flex:0 0 auto;}
.contactChatSheet__close{appearance:none;-webkit-appearance:none;width:auto;min-width:0;height:auto;padding:0;border:none;border-radius:0;background:transparent;color:#111;font-size:26px;font-weight:600;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.contactChatSheet__head{appearance:none;-webkit-appearance:none;min-width:0;display:flex;align-items:center;gap:12px;border:none;background:transparent;padding:0;text-align:left;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.contactChatSheet__headInfo{min-width:0;display:flex;flex-direction:column;gap:4px;}
.contactChatSheet__name{font-size:18px;font-weight:588;line-height:1.2;color:#111;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.contactChatSheet__status{font-size:16px;font-weight:400;line-height:1.2;color:rgba(0,0,0,.5);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.contactChatSheet__messages{flex:1;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;touch-action:pan-y;padding:14px;background:#fff;display:flex;flex-direction:column;gap:10px;}
.contactMessageBlock{display:flex;flex-direction:column;gap:6px;max-width:min(78%, 420px);}
.contactMessageRow{display:flex;}
.contactMessageRow--me{justify-content:flex-end;}
.contactMessageRow--other{justify-content:flex-start;}
.contactMessageBubble{padding:12px 14px;border-radius:18px;font-size:16px;font-weight:400;line-height:1.38;word-break:break-word;white-space:pre-wrap;}
.contactMessageRow--me .contactMessageBubble{background:#ff8db3;color:#fff;border-bottom-right-radius:8px;}
.contactMessageRow--other .contactMessageBubble{background:rgba(255,47,109,.14);color:#111;border-bottom-left-radius:8px;}
.contactMessageRow--me .contactMessageMeta{justify-content:flex-end;color:rgba(0,0,0,.52);}
.contactMessageRow--other .contactMessageMeta{justify-content:flex-start;color:rgba(0,0,0,.44);}
.contactMessageMeta{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:400;line-height:1.2;}

.contactQuickPost{display:flex;flex-direction:column;gap:10px;}
.contactQuickPost__card{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid rgba(0,0,0,.1);border-radius:18px;background:#fff;min-width:0;}
.contactQuickPost__cardBtn{appearance:none;-webkit-appearance:none;width:100%;text-align:left;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.contactQuickPost__thumb{display:block;width:118px;height:86px;object-fit:cover;border-radius:18px;background:#f1f1f1;flex:0 0 118px;}
.contactQuickPost__thumb--empty{background:#f3f3f3;}
.contactQuickPost__meta{display:flex;flex-direction:column;gap:10px;min-width:0;}
.contactQuickPost__title{font-size:16px;font-weight:500;line-height:1.3;color:#111;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.contactQuickPost__price{font-size:16px;font-weight:700;line-height:1.2;color:#ff2f6d;}
.contactQuickPost__text{font-size:16px;font-weight:400;line-height:1.38;color:inherit;white-space:pre-wrap;word-break:break-word;}
.contactChatSheet__composer{display:flex;align-items:flex-end;gap:10px;padding:10px 14px calc(10px + env(safe-area-inset-bottom));border-top:1px solid rgba(0,0,0,.08);background:#fff;flex:0 0 auto;}
.contactChatSheet__input{flex:1;min-height:48px;max-height:140px;border:1.5px solid rgba(0,0,0,.12);border-radius:18px;padding:13px 16px;font-size:16px;font-weight:400;line-height:1.35;color:#111;resize:none;background:#fff;outline:none;box-shadow:none;}
.contactChatSheet__input:focus{border-color:#ef5da8;box-shadow:none;} /* SP v195: bỏ viền ngoài ô nhập chat */
.contactChatSheet__send{height:48px;min-width:78px;padding:0 16px;border-radius:18px;background:#ff2f6d;color:#fff;font-size:18px;font-weight:588;line-height:1;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}

/* SP v190: Chat app mới dùng trang chuẩn có route, không dùng popup/fixed overlay cho khung chat chính. */
.routePage[data-route-page="chat"]{padding-top:0;padding-bottom:0;}
body.is-chat-room-route .appHeader,
body.is-chat-room-route .bottomNav{display:none;}
body.is-chat-room-route .pageShell{min-height:100dvh;padding:0;background:#fff;}
body.is-chat-room-route .routePage[data-route-page="chat"]{min-height:100dvh;padding:0;}
.contactChatSheet--route{position:relative;inset:auto;z-index:auto;height:100dvh;min-height:100dvh;}
.contactMessageDayDivider{display:flex;align-items:center;justify-content:center;margin:4px 0 2px;}
.contactMessageDayDivider span{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:0 12px;border-radius:999px;background:rgba(0,0,0,.18);color:#fff;font-size:14px;font-weight:500;line-height:1;}
.contactEmpty--login{text-align:center;}
.contactPage--loginRequired{padding:24px 0;}

/* SP v197: Nút X ô tìm kiếm danh bạ dùng chung mẫu v196 */
.contactSearchClear{position:absolute;right:24px;top:21px;transform:translateY(-50%);z-index:2;}
.contactSearchClear:active{transform:translateY(-50%) scale(.94);}
.contactSearchInput{padding-right:49px;}
.contactSearchInput::-webkit-search-cancel-button,
.contactSearchInput::-webkit-search-decoration{display:none;-webkit-appearance:none;}


/* SP v200: Card chat nhanh giống tin đã lưu, text nằm dưới card */
.contactQuickPost{display:flex;flex-direction:column;gap:8px;min-width:0;}
.contactQuickPost__card{display:flex;align-items:center;gap:12px;width:100%;padding:10px;border:1px solid rgba(0,0,0,.1);border-radius:16px;background:#fff;min-width:0;color:#111;}
.contactQuickPost__cardBtn{appearance:none;-webkit-appearance:none;text-align:left;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.contactQuickPost__thumb{display:block;width:78px;height:78px;object-fit:cover;border-radius:14px;background:#f1f1f1;flex:0 0 78px;}
.contactQuickPost__thumb--empty{background:#f3f3f3;}
.contactQuickPost__meta{display:flex;flex-direction:column;gap:8px;min-width:0;flex:1;}
.contactQuickPost__title{font-size:16px;font-weight:500;line-height:1.3;color:#111;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.contactQuickPost__price{font-size:16px;font-weight:700;line-height:1.2;color:#ff2f6d;}
.contactQuickPost__text{font-size:16px;font-weight:500;line-height:1.38;color:inherit;white-space:pre-wrap;word-break:break-word;}

/* SP v201: Cắt khoảng trắng khi bật bàn phím ở trang chat, chỉ áp dụng cho chat route */
.contactChatSheet--route{
  height:var(--contact-chat-vh, 100dvh);
  min-height:var(--contact-chat-vh, 100dvh);
  max-height:var(--contact-chat-vh, 100dvh);
  overflow:hidden;
}
.contactChatSheet--route .contactChatSheet__messages{
  flex:1 1 auto;
  min-height:0;
}
.contactChatSheet--route .contactChatSheet__composer{
  padding-top:8px;
  padding-bottom:max(8px, env(safe-area-inset-bottom));
  margin-bottom:0;
}

/* SP v206: Popup chat nhanh khi xem tin - cao 50%, card nằm trong ô nhập và xoá được */
.contactChatSheet--popup{
  inset:auto 0 0 0;
  height:50dvh;
  min-height:50dvh;
  max-height:50dvh;
  border-radius:22px 22px 0 0;
  box-shadow:0 -12px 34px rgba(0,0,0,.18);
  z-index:9600;
}
.contactChatSheet--popup .contactChatSheet__bar{
  padding:12px 14px 10px;
  border-radius:22px 22px 0 0;
}
.contactChatSheet--popup .contactChatSheet__avatar{
  width:42px;
  height:42px;
  font-size:15px;
}
.contactChatSheet--popup .contactChatSheet__name{
  font-size:18px;
}
.contactChatSheet--popup .contactChatSheet__status{
  font-size:14px;
}
.contactChatSheet--popup .contactChatSheet__messages{
  padding:10px 12px;
  gap:8px;
}
.contactChatSheet--popup .contactMessageBlock{
  max-width:min(86%, 420px);
}
.contactChatSheet--popup .contactMessageBubble{
  padding:10px 12px;
  border-radius:16px;
  font-size:15px;
}
.contactChatSheet--popup .contactChatSheet__composer{
  align-items:flex-end;
  gap:8px;
  padding:8px 10px max(8px, env(safe-area-inset-bottom));
}
.contactChatSheet__inputBox{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
  border:1.5px solid rgba(0,0,0,.12);
  border-radius:19px;
  background:#fff;
  padding:5px 8px;
}
.contactChatSheet__inputBox:focus-within{
  border-color:#ef5da8;
}
.contactChatSheet__inputRow{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.contactChatSheet__attach{
  appearance:none;
  -webkit-appearance:none;
  width:28px;
  height:28px;
  flex:0 0 28px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:none;
  background:transparent;
  color:#111;
  font-size:30px;
  font-weight:400;
  line-height:28px;
  padding:0;
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.contactChatSheet__inputBox .contactChatSheet__input{
  min-height:28px;
  height:28px;
  max-height:120px;
  border:none;
  border-radius:0;
  padding:3px 34px 3px 0;
  font-size:15px;
  line-height:1.35;
  box-shadow:none;
}
.contactChatSheet__inputBox .contactChatSheet__input:focus{
  border:none;
  box-shadow:none;
}
.contactChatSheet--popup .contactChatSheet__send{
  height:38px;
  min-width:62px;
  border-radius:19px;
  font-size:16px;
}
.contactChatSheet__composeCard[hidden]{display:none !important;}
.contactComposerPost{
  position:relative;
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  padding:6px 32px 6px 6px;
  border:1px solid rgba(0,0,0,.1);
  border-radius:14px;
  background:#fafafa;
}
.contactComposerPost__thumb{
  display:block;
  width:42px;
  height:42px;
  flex:0 0 42px;
  object-fit:cover;
  border-radius:10px;
  background:#f1f1f1;
}
.contactComposerPost__thumb--empty{background:#f1f1f1;}
.contactComposerPost__body{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}
.contactComposerPost__title{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#111;
  font-size:13px;
  font-weight:500;
  line-height:1.25;
}
.contactComposerPost__price{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#ff2f6d;
  font-size:13px;
  font-weight:700;
  line-height:1.2;
}
.contactComposerPost__remove{
  appearance:none;
  -webkit-appearance:none;
  position:absolute;
  top:50%;
  right:7px;
  transform:translateY(-50%);
  width:24px;
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:none;
  border-radius:0;
  background:transparent;
  color:#111;
  font-size:22px;
  font-weight:500;
  line-height:1;
  padding:0;
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.contactComposerPost__remove:active{transform:translateY(-50%) scale(.94);}

/* SP v207: canh giữa dấu + và nút X trong ô nhập popup chat, chừa X của card */
.contactChatSheet__inputBox .appInputClear.appInputClear--auto{
  right:10px !important;
  top:auto !important;
  bottom:8px !important;
  transform:none !important;
}
.contactChatSheet__inputBox .appInputClear.appInputClear--auto:active{transform:scale(.94) !important;}
.contactChatSheet__inputBox .contactChatSheet__input.appInputClearTarget{padding-right:34px !important;}
.contactChatSheet__composeCard:not([hidden]) + .contactChatSheet__inputRow .appInputClear.appInputClear--auto{bottom:8px !important;}


/* SP v208: làm lại từ v207 - canh dấu +, giữ bàn phím khi xoá card, bấm ngoài đóng popup */
.contactChatPopupHost{
  position:fixed;
  inset:0;
  z-index:9599;
  background:transparent;
}
.contactChatPopupBackdrop{
  position:absolute;
  inset:0;
  background:transparent;
}
.contactChatPopupHost .contactChatSheet--popup{
  z-index:9600;
}
.contactChatSheet__inputBox{
  padding:5px 10px;
}
.contactChatSheet__inputRow{
  align-items:center;
  min-height:30px;
}
.contactChatSheet__attach{
  width:36px;
  height:30px;
  flex:0 0 36px;
  font-size:31px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 0 1px;
  margin:0;
}
.contactChatSheet__inputBox .contactChatSheet__input{
  min-height:30px;
  height:30px;
  padding-top:4px;
  padding-bottom:4px;
}
.contactChatSheet__inputBox .appInputClear.appInputClear--auto{
  top:auto !important;
  bottom:8px !important;
  right:10px !important;
  transform:none !important;
}
.contactChatSheet__composeCard:not([hidden]) + .contactChatSheet__inputRow .appInputClear.appInputClear--auto{
  bottom:8px !important;
}


/* SP v209: sửa khung chat chính bám sát bàn phím, ô nhập nhỏ gọn như popup chat nhanh, không có dấu + */
body.is-chat-room-route{
  overflow:hidden;
  background:#fff;
}
.contactChatSheet--route{
  position:fixed;
  left:0;
  right:0;
  top:var(--contact-chat-top, 0px);
  bottom:auto;
  height:var(--contact-chat-vh, 100dvh);
  min-height:0;
  max-height:none;
  z-index:1300;
  transform:translateZ(0);
}
.contactChatSheet--route .contactChatSheet__composer{
  align-items:flex-end;
  gap:8px;
  padding:8px 10px max(8px, env(safe-area-inset-bottom));
  border-top:1px solid rgba(0,0,0,.08);
  background:#fff;
}
.contactChatSheet--route .contactChatSheet__inputBox{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:0;
  min-height:38px;
  border:1.5px solid rgba(0,0,0,.12);
  border-radius:19px;
  background:#fff;
  padding:4px 10px;
}
.contactChatSheet--route .contactChatSheet__inputBox:focus-within{
  border-color:#ef5da8;
}
.contactChatSheet--route .contactChatSheet__inputRow{
  display:flex;
  align-items:center;
  min-height:30px;
  gap:0;
}
.contactChatSheet--route .contactChatSheet__inputBox .contactChatSheet__input{
  flex:1;
  min-height:30px;
  height:30px;
  max-height:96px;
  border:none;
  border-radius:0;
  padding:4px 34px 4px 0;
  font-size:15px;
  line-height:1.35;
  background:#fff;
  box-shadow:none;
}
.contactChatSheet--route .contactChatSheet__inputBox .contactChatSheet__input:focus{
  border:none;
  box-shadow:none;
}
.contactChatSheet--route .contactChatSheet__send{
  height:38px;
  min-width:62px;
  border-radius:19px;
  font-size:16px;
}
.contactChatSheet--route .contactChatSheet__inputBox .appInputClear.appInputClear--auto{
  top:50% !important;
  right:10px !important;
  bottom:auto !important;
  transform:translateY(-50%) !important;
}
.contactChatSheet--route .contactChatSheet__inputBox .appInputClear.appInputClear--auto:active{
  transform:translateY(-50%) scale(.94) !important;
}

/* SP v209: Card tin nhắn không còn bị nền hồng bao chung, chỉ card có viền xám riêng */
.contactMessageBubble:has(.contactQuickPost){
  padding:0;
  background:transparent !important;
  color:#111;
  white-space:normal;
}
.contactQuickPost__card{
  border:1px solid rgba(0,0,0,.14);
  background:#fff;
  box-shadow:none;
}
.contactMessageRow--me .contactQuickPost__text{
  align-self:flex-end;
  display:inline-block;
  max-width:100%;
  margin-top:8px;
  padding:10px 12px;
  border-radius:16px;
  border-bottom-right-radius:8px;
  background:#ff8db3;
  color:#fff;
}
.contactMessageRow--other .contactQuickPost__text{
  align-self:flex-start;
  display:inline-block;
  max-width:100%;
  margin-top:8px;
  padding:10px 12px;
  border-radius:16px;
  border-bottom-left-radius:8px;
  background:rgba(255,47,109,.14);
  color:#111;
}

/* SP v210: chỉnh màu bong bóng chat tươi hơn + thêm đuôi nhọn kiểu iMessage, cân lại ô nhập */
.contactMessageBubble{
  position:relative;
}
.contactMessageRow--me .contactMessageBubble:not(:has(.contactQuickPost)){
  background:#ff2f6d;
  color:#fff;
  border-bottom-right-radius:6px;
}
.contactMessageRow--other .contactMessageBubble:not(:has(.contactQuickPost)){
  background:#e9e4df;
  color:#000;
  border-bottom-left-radius:6px;
}
.contactMessageRow--me .contactMessageBubble:not(:has(.contactQuickPost))::after{
  content:"";
  position:absolute;
  right:-5px;
  bottom:4px;
  width:12px;
  height:12px;
  background:#ff2f6d;
  border-radius:2px;
  transform:rotate(45deg);
}
.contactMessageRow--other .contactMessageBubble:not(:has(.contactQuickPost))::after{
  content:"";
  position:absolute;
  left:-5px;
  bottom:4px;
  width:12px;
  height:12px;
  background:#e9e4df;
  border-radius:2px;
  transform:rotate(45deg);
}
.contactMessageRow--me .contactQuickPost__text{
  position:relative;
  background:#ff2f6d;
  color:#fff;
  border-bottom-right-radius:6px;
}
.contactMessageRow--other .contactQuickPost__text{
  position:relative;
  background:#e9e4df;
  color:#000;
  border-bottom-left-radius:6px;
}
.contactMessageRow--me .contactQuickPost__text::after{
  content:"";
  position:absolute;
  right:-5px;
  bottom:4px;
  width:12px;
  height:12px;
  background:#ff2f6d;
  border-radius:2px;
  transform:rotate(45deg);
}
.contactMessageRow--other .contactQuickPost__text::after{
  content:"";
  position:absolute;
  left:-5px;
  bottom:4px;
  width:12px;
  height:12px;
  background:#e9e4df;
  border-radius:2px;
  transform:rotate(45deg);
}
.contactChatSheet--route .contactChatSheet__composer{
  align-items:center;
}
.contactChatSheet--route .contactChatSheet__inputBox{
  min-height:38px;
  height:38px;
  justify-content:center;
  padding:0 12px;
}
.contactChatSheet--route .contactChatSheet__inputRow{
  min-height:36px;
  height:36px;
  align-items:center;
}
.contactChatSheet--route .contactChatSheet__inputBox .contactChatSheet__input{
  min-height:24px;
  height:24px;
  max-height:86px;
  padding:0 34px 0 0;
  line-height:24px;
  display:block;
  overflow-y:auto;
}
.contactChatSheet--route .contactChatSheet__inputBox .contactChatSheet__input::placeholder{
  line-height:24px;
}
.contactChatSheet--route .contactChatSheet__send{
  align-self:center;
}

/* SP v213: làm kỹ lại từ v210 - đổi bong bóng người chat sang xám, sửa đuôi nhọn hướng xuống và chỉ còn 1 đuôi */
.contactMessageRow--me .contactMessageBubble:not(:has(.contactQuickPost)){
  background:#ff2f6d;
  color:#fff;
  border-bottom-right-radius:6px;
}
.contactMessageRow--other .contactMessageBubble:not(:has(.contactQuickPost)){
  background:#e5e5ea;
  color:#000;
  border-bottom-left-radius:6px;
}
.contactMessageRow--me .contactMessageBubble:not(:has(.contactQuickPost))::after{
  content:"";
  position:absolute;
  right:-6px;
  bottom:0;
  width:13px;
  height:13px;
  background:#ff2f6d;
  border-radius:0;
  transform:none;
  clip-path:polygon(0 0, 100% 100%, 0 100%);
}
.contactMessageRow--other .contactMessageBubble:not(:has(.contactQuickPost))::after{
  content:"";
  position:absolute;
  left:-6px;
  bottom:0;
  width:13px;
  height:13px;
  background:#e5e5ea;
  border-radius:0;
  transform:none;
  clip-path:polygon(100% 0, 0 100%, 100% 100%);
}
.contactMessageRow--me .contactQuickPost__text{
  background:#ff2f6d;
  color:#fff;
  border-bottom-right-radius:6px;
}
.contactMessageRow--other .contactQuickPost__text{
  background:#e5e5ea;
  color:#000;
  border-bottom-left-radius:6px;
}
.contactMessageRow--me .contactQuickPost__text::after{
  content:"";
  position:absolute;
  right:-6px;
  bottom:0;
  width:13px;
  height:13px;
  background:#ff2f6d;
  border-radius:0;
  transform:none;
  clip-path:polygon(0 0, 100% 100%, 0 100%);
}
.contactMessageRow--other .contactQuickPost__text::after{
  content:"";
  position:absolute;
  left:-6px;
  bottom:0;
  width:13px;
  height:13px;
  background:#e5e5ea;
  border-radius:0;
  transform:none;
  clip-path:polygon(100% 0, 0 100%, 100% 100%);
}

/* SP v214: sửa ô nhập chat bung nhiều dòng không bị đứt viền trên/dưới */
.contactChatSheet__composer,
.contactChatSheet--popup .contactChatSheet__composer,
.contactChatSheet--route .contactChatSheet__composer{
  align-items:center;
}
.contactChatSheet__inputBox,
.contactChatSheet--route .contactChatSheet__inputBox{
  height:auto;
  min-height:38px;
  justify-content:center;
  padding-top:4px;
  padding-bottom:4px;
  box-sizing:border-box;
}
.contactChatSheet__inputRow,
.contactChatSheet--route .contactChatSheet__inputRow{
  height:auto;
  min-height:30px;
  align-items:center;
}
.contactChatSheet__inputBox .contactChatSheet__input,
.contactChatSheet--route .contactChatSheet__inputBox .contactChatSheet__input{
  height:auto;
  min-height:30px;
  max-height:120px;
  line-height:20px;
  padding-top:5px;
  padding-bottom:5px;
  box-sizing:border-box;
  overflow-y:auto;
}
.contactChatSheet__inputBox .appInputClear.appInputClear--auto,
.contactChatSheet--route .contactChatSheet__inputBox .appInputClear.appInputClear--auto{
  top:50% !important;
  bottom:auto !important;
  transform:translateY(-50%) !important;
}
.contactChatSheet__inputBox .appInputClear.appInputClear--auto:active,
.contactChatSheet--route .contactChatSheet__inputBox .appInputClear.appInputClear--auto:active{
  transform:translateY(-50%) scale(.94) !important;
}


/* SP v215: khi bàn phím mở ở trang chat, chiều cao lấy theo visualViewport để đoạn chat bị đẩy lên trên bàn phím */
.contactChatSheet--route{
  height:var(--contact-chat-vh, 100dvh) !important;
  min-height:0 !important;
  max-height:var(--contact-chat-vh, 100dvh) !important;
  top:var(--contact-chat-top, 0px) !important;
  bottom:auto !important;
}
.contactChatSheet--route .contactChatSheet__messages{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  padding-bottom:14px;
}

/* SP v216: chỉ sửa nút X xoá kí tự của ô chat nhanh nằm dưới, không đụng X khác */
.contactChatSheet--popup .contactChatSheet__inputBox .appInputClear.appInputClear--auto{
  top:auto !important;
  bottom:8px !important;
  transform:none !important;
}
.contactChatSheet--popup .contactChatSheet__inputBox .appInputClear.appInputClear--auto:active{
  transform:scale(.94) !important;
}
.contactChatSheet--popup .contactChatSheet__composeCard:not([hidden]) + .contactChatSheet__inputRow .appInputClear.appInputClear--auto{
  bottom:8px !important;
}

/* SP v227: giữ Safari native scroll, chỉ dùng nhún nhẹ cho chat ngắn để không kéo nguyên khung trang */
.contactChatSheet--route .contactChatSheet__messages{
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  --contact-chat-pull-y:0px;
}
.contactChatSheet__messages.is-chat-pulling > *{
  transform:translate3d(0,var(--contact-chat-pull-y),0);
  will-change:transform;
}
.contactChatSheet__messages.is-chat-release > *{
  transition:transform .24s cubic-bezier(.22,.61,.36,1);
}

/* SP v226: Vuốt trái đoạn chat để lộ nút xoá, không đổi bố cục danh sách. */
.contactThreadSwipe{
  position:relative;
  overflow:hidden;
  background:#fff;
  touch-action:pan-y;
}
.contactThreadSwipe__item{
  position:relative;
  z-index:2;
  will-change:transform;
  transform:translate3d(0,0,0);
}
.contactThreadDelete{
  appearance:none;
  -webkit-appearance:none;
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  z-index:1;
  width:104px;
  border:none;
  border-radius:0;
  background:#ff2f6d;
  color:#fff;
  font-size:18px;
  font-weight:588;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.contactThreadDelete:disabled{
  opacity:.65;
}

/* SP v374: popup Đoạn chat PC nổi bên phải, dùng lại khung Đoạn chat/Danh bạ cũ. Không ảnh hưởng mobile. */
@media (min-width: 900px){
  .contactChatPopupHost--pcList{
    position:fixed;
    top:0;
    right:0;
    bottom:0;
    left:0;
    z-index:2147483000;
    pointer-events:none;
  }
  .contactPcListPopup{
    position:fixed;
    top:78px; /* SP sửa khoảng cách popup với mép trên PC tại đây */
    right:16px; /* SP sửa khoảng cách popup với mép phải PC tại đây */
    bottom:16px; /* SP sửa khoảng cách popup với mép dưới PC tại đây */
    width:388px; /* SP sửa chiều ngang popup chat PC tại đây */
    max-width:calc(100vw - 32px);
    display:flex;
    flex-direction:column;
    overflow:hidden;
    border:1px solid rgba(0,0,0,.08);
    border-radius:14px;
    background:#fff;
    box-shadow:0 10px 34px rgba(0,0,0,.22);
    pointer-events:auto;
  }
  .contactPcListPopup__head{
    flex:0 0 auto;
    height:54px; /* SP sửa chiều cao đầu popup chat PC tại đây */
    display:flex;
    align-items:center;
    gap:8px;
    padding:0 14px;
    border-bottom:1px solid rgba(0,0,0,.06);
    background:#fff;
  }
  .contactPcListPopup__title{
    flex:1 1 auto;
    min-width:0;
    color:#111;
    font-size:20px; /* SP sửa cỡ chữ tiêu đề popup chat PC tại đây */
    font-weight:588;
    line-height:1.1;
  }
  .contactPcListPopup__icon{
    appearance:none;
    -webkit-appearance:none;
    flex:0 0 auto;
    width:34px; /* SP sửa kích thước nút icon popup chat PC tại đây */
    height:34px;
    border:none;
    border-radius:9px;
    background:#fff;
    color:#555;
    font-size:24px;
    font-weight:588;
    line-height:1;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
  }
  .contactPcListPopup__icon:hover{
    background:#f1f2f4;
    color:#111;
  }
  .contactPcListPopup__body{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    background:#fff;
  }
  .contactPcListPopup .contactPage{
    min-height:100%;
    padding:10px 12px 12px;
    background:#fff;
  }
  .contactPcListPopup .contactTabs{
    margin:0 0 10px;
  }
  .contactPcListPopup .contactTabs__btn{
    font-size:18px; /* SP sửa cỡ chữ tab Đoạn chat/Danh bạ PC tại đây */
    font-weight:588;
  }
  .contactPcListPopup .contactListItem{
    min-height:66px;
    padding:8px 2px;
  }
  .contactPcListPopup .contactListItem__name{
    font-size:17px; /* SP sửa cỡ chữ tên trong danh sách popup chat PC tại đây */
    font-weight:588;
  }
  .contactPcListPopup .contactListItem__text,
  .contactPcListPopup .contactListItem__time,
  .contactPcListPopup .contactEmpty,
  .contactPcListPopup .contactContactsTitle,
  .contactPcListPopup .contactSearchInput{
    font-size:16px; /* SP sửa cỡ chữ nội dung phụ popup chat PC tại đây */
  }
  .contactPcListPopup__full{
    appearance:none;
    -webkit-appearance:none;
    flex:0 0 auto;
    height:46px; /* SP sửa chiều cao nút xem tất cả popup chat PC tại đây */
    border:none;
    border-top:1px solid rgba(0,0,0,.08);
    background:#fff;
    color:#ff2f6d;
    font-size:16px;
    font-weight:588;
    cursor:pointer;
  }
  .contactPcListPopup__full:hover{
    background:#fafafa;
  }
}

/* SP v377: menu nút + trong chat: chọn card bài / chọn ảnh */
.contactChatSheet__attachWrap{
  position:relative;
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.contactChatAttachMenu{
  position:absolute;
  left:0;
  bottom:calc(100% + 8px);
  z-index:9800;
  min-width:150px;
  padding:6px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:14px;
  background:#fff;
  box-shadow:0 12px 32px rgba(0,0,0,.18);
}
.contactChatAttachMenu[hidden]{display:none!important;}
.contactChatAttachMenu__item{
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding:0 12px;
  border:0;
  border-radius:10px;
  background:#fff;
  color:#111;
  font-size:16px;
  font-weight:500;
  line-height:1.2;
  text-align:left;
  cursor:pointer;
}
.contactChatAttachMenu__item:active,
.contactChatAttachMenu__item:hover{background:rgba(255,47,109,.10);color:#ff2f6d;}
.contactChatImageMessage{
  appearance:none;
  -webkit-appearance:none;
  display:block;
  max-width:min(260px, 72vw);
  padding:0;
  border:0;
  border-radius:16px;
  overflow:hidden;
  background:transparent;
  cursor:pointer;
}
.contactChatImageMessage__img{
  display:block;
  width:100%;
  max-height:320px;
  object-fit:cover;
  border-radius:16px;
}
.contactMessageBubble:has(.contactChatImageMessage){
  padding:0!important;
  background:transparent!important;
  color:inherit!important;
  white-space:normal;
}
.contactChatSheet__send:disabled{opacity:.55;pointer-events:none;}

@media (max-width:899px){
  .contactChatAttachMenu{
    min-width:145px;
    border-radius:14px;
  }
  .contactChatImageMessage{max-width:min(240px, 72vw);}
  .contactChatImageMessage__img{max-height:280px;}
}


/* SP v379: gửi nhiều ảnh thành 1 tin nhắn nhóm ảnh */
.contactChatImageGrid{
  display:grid;
  gap:2px;
  width:min(270px, 72vw); /* SP sửa chiều ngang nhóm ảnh chat tại đây */
  overflow:hidden;
  border-radius:14px;
  background:transparent;
}
.contactChatImageGrid--count1{grid-template-columns:1fr;}
.contactChatImageGrid--count2{grid-template-columns:1fr 1fr;}
.contactChatImageGrid--count3{grid-template-columns:1fr 1fr 1fr;}
.contactChatImageGrid--count4,
.contactChatImageGrid--count5,
.contactChatImageGrid--count6{grid-template-columns:repeat(3, 1fr);}
.contactChatImageGrid__item{
  appearance:none;
  -webkit-appearance:none;
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:1/1;
  padding:0;
  border:0;
  overflow:hidden;
  background:#eee;
  cursor:pointer;
}
.contactChatImageGrid--count1 .contactChatImageGrid__item{aspect-ratio:4/3;}
.contactChatImageGrid--count2 .contactChatImageGrid__item{aspect-ratio:1/1.12;}
.contactChatImageGrid__img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.contactChatImageGrid__more{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.48);
  color:#fff;
  font-size:22px;
  font-weight:700;
}
.contactMessageBubble:has(.contactChatImageGrid){
  padding:0!important;
  background:transparent!important;
  color:inherit!important;
  white-space:normal;
}

@media (max-width:899px){
  .contactChatImageGrid{width:min(260px, 74vw);}
}

/* SP v378 làm lại từ v377: chọn nhiều ảnh, xem trước rồi bấm Gửi mới gửi */
.contactChatSheet__composeImages[hidden]{display:none!important;}
.contactComposerImages{
  display:flex;
  align-items:center;
  gap:6px;
  max-width:100%;
  overflow-x:auto;
  padding:2px 0 1px;
  -webkit-overflow-scrolling:touch;
}
.contactComposerImage{
  position:relative;
  width:54px; /* SP sửa kích thước ảnh chờ gửi tại đây */
  height:54px;
  flex:0 0 54px;
  border-radius:12px;
  background:#f2f2f2;
  overflow:hidden;
}
.contactComposerImage__img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.contactComposerImage__img--empty{background:#f2f2f2;}
.contactComposerImage__remove{
  appearance:none;
  -webkit-appearance:none;
  position:absolute;
  top:3px;
  right:3px;
  width:20px;
  height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:999px;
  background:rgba(0,0,0,.68);
  color:#fff;
  font-size:16px;
  font-weight:600;
  line-height:20px;
  padding:0;
  cursor:pointer;
}
.contactChatSheet__attach{line-height:1;}

/* SP v380: Trang chat trên điện thoại dùng vuốt ảnh, bỏ icon qua/lại trong trình xem ảnh. */
@media (max-width: 767px){
  .photoViewer.photoViewer--chat .photoViewer__nav{
    display:none !important;
  }
}

/* SP v381: PC - trang xem tất cả chat chia khung rõ từng phần, ẩn breadcrumb riêng trang chat. Không ảnh hưởng điện thoại. */
@media (min-width:1024px){
  body.is-chat-route .pcBreadcrumb{
    display:none !important;
  }

  body.is-chat-route .pageShell{
    padding-top:var(--pc-topbar-height, 62px) !important;
    padding-left:0 !important;
    padding-right:0 !important;
    background:#f6f7f9;
  }

  body.is-chat-room-route{
    overflow:hidden;
    background:#f6f7f9;
  }

  body.is-chat-room-route .appHeader,
  body.is-chat-room-route .bottomNav{
    display:none;
  }

  .routePage[data-route-page="chat"].is-active{
    /* SP v382: tăng rộng đều khung chat PC qua 2 bên, không đụng mobile. */
    width:min(1360px, calc(100vw - 56px)) !important;
    max-width:min(1360px, calc(100vw - 56px)) !important;
    height:calc(100dvh - var(--pc-topbar-height, 62px) - 18px);
    min-height:0 !important;
    margin:0 auto !important;
    padding:18px 0 0 !important;
    box-sizing:border-box;
    overflow:hidden;
  }

  .contactPcChatPage{
    width:100%;
    height:100%;
    display:grid;
    grid-template-columns:360px minmax(0, 1fr); /* SP chỉnh chiều ngang danh sách chat PC tại đây */
    gap:14px;
    min-height:0;
  }

  .contactPcChatPage__list,
  .contactPcChatPage__room{
    min-width:0;
    min-height:0;
    background:#fff;
    border:1px solid rgba(0,0,0,.12); /* SP chỉnh viền khung chat PC tại đây */
    border-radius:18px;
    box-shadow:0 8px 24px rgba(0,0,0,.06);
    overflow:hidden;
  }

  .contactPcChatPage__list{
    display:flex;
    flex-direction:column;
  }

  .contactPcChatPage__list .contactPage{
    height:100%;
    min-height:0;
    padding:0;
    display:flex;
    flex-direction:column;
  }

  .contactPcChatPage__list .contactTabs{
    flex:0 0 auto;
    padding:14px;
    gap:10px;
    border-bottom:1px solid rgba(0,0,0,.10); /* SP chỉnh đường ngăn tab chat PC tại đây */
    background:#fff;
  }

  .contactPcChatPage__list .contactTabs__btn{
    height:38px;
    font-size:17px;
  }

  .contactPcChatPage__list .contactPanel{
    flex:1 1 auto;
    min-height:0;
    overflow:auto;
    padding:0;
  }

  .contactPcChatPage__list .contactList{
    gap:0;
  }

  .contactPcChatPage__list .contactListItem{
    padding:14px 14px;
    gap:12px;
    border-bottom:1px solid rgba(0,0,0,.07); /* SP chỉnh đường ngăn từng đoạn chat PC tại đây */
  }

  /* SP v382: PC ẩn nút xoá đoạn chat khi không thao tác, tránh tự lộ nút xoá. */
  .contactPcChatPage .contactThreadDelete{
    opacity:0;
    pointer-events:none;
    transition:opacity .16s ease;
  }

  .contactPcChatPage .contactThreadSwipe:hover .contactThreadDelete,
  .contactPcChatPage .contactThreadSwipe:focus-within .contactThreadDelete,
  .contactPcChatPage .contactThreadSwipe.is-open .contactThreadDelete{
    opacity:1;
    pointer-events:auto;
  }

  .contactPcChatPage .contactThreadSwipe:not(.is-open) .contactThreadSwipe__item{
    transform:translate3d(0,0,0) !important;
  }


  .contactPcChatPage__list .contactListItem:hover,
  .contactPcChatPage__list .contactListItem.is-active{
    background:rgba(255,47,109,.07);
  }

  .contactPcChatPage__list .contactListItem__avatar{
    width:50px;
    height:50px;
    font-size:16px;
  }

  .contactPcChatPage__list .contactListItem__name{
    font-size:17px;
  }

  .contactPcChatPage__list .contactListItem__text{
    font-size:15px;
    color:rgba(0,0,0,.58);
  }

  .contactPcChatPage__list .contactContactsHead{
    padding:0;
    border-top:0;
  }

  .contactPcChatPage__list .contactContactsTitle{
    padding:14px 14px 10px;
  }

  .contactPcChatPage__list .contactSearchWrap{
    margin:0;
    padding:0 14px 12px;
    border-bottom:1px solid rgba(0,0,0,.08);
  }

  .contactPcChatPage__room{
    display:flex;
    flex-direction:column;
  }

  .contactPcChatPage__room .contactChatSheet--route{
    position:relative !important;
    inset:auto !important;
    top:auto !important;
    left:auto !important;
    right:auto !important;
    bottom:auto !important;
    width:100%;
    height:100% !important;
    min-height:0 !important;
    max-height:none !important;
    z-index:auto !important;
    border-radius:0;
  }

  .contactPcChatPage__room .contactChatSheet__bar{
    min-height:66px; /* SP chỉnh chiều cao header người chat PC tại đây */
    padding:12px 16px;
    border-bottom:1px solid rgba(0,0,0,.12); /* SP chỉnh đường ngăn header chat PC tại đây */
    background:#fff;
  }

  .contactPcChatPage__room .contactChatSheet__close{
    display:none;
  }

  .contactPcChatPage__room .contactChatSheet__avatar{
    width:48px;
    height:48px;
    font-size:16px;
  }

  .contactPcChatPage__room .contactChatSheet__name{
    font-size:18px;
    font-weight:588;
    max-width:520px;
  }

  .contactPcChatPage__room .contactChatSheet__status{
    font-size:15px;
  }

  .contactPcChatPage__room .contactChatSheet__messages{
    flex:1 1 auto;
    min-height:0;
    padding:18px 22px;
    border-bottom:1px solid rgba(0,0,0,.10); /* SP chỉnh đường ngăn vùng tin nhắn và ô nhập PC tại đây */
    background:#fff;
  }

  .contactPcChatPage__room .contactChatSheet__composer{
    flex:0 0 auto;
    padding:12px 16px;
    background:#fff;
    border-top:0;
  }

  .contactPcChatPage__room .contactMessageBlock{
    max-width:min(66%, 560px);
  }

  .contactPcChatEmptyRoom{
    height:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:8px;
    color:rgba(0,0,0,.55);
    text-align:center;
    padding:24px;
    box-sizing:border-box;
  }

  .contactPcChatEmptyRoom__title{
    font-size:20px;
    font-weight:588;
    color:#111;
  }

  .contactPcChatEmptyRoom__text{
    font-size:16px;
    font-weight:400;
  }
}

/* SP v383: PC - làm lại từ v382, giảm khung đoạn chat 120px, canh giữa, menu 3 vạch mới hiện xoá đoạn chat. Không ảnh hưởng mobile. */
@media (min-width:1024px){
  body.is-chat-route .routePage[data-route-page="chat"].is-active,
  .routePage[data-route-page="chat"].is-active{
    width:min(1490px, calc(100vw - 56px)) !important; /* SP chỉnh chiều ngang tổng khung chat PC tại đây */
    max-width:min(1490px, calc(100vw - 56px)) !important;
    margin-left:auto !important;
    margin-right:auto !important;
    overflow:hidden !important;
  }

  .contactPcChatPage{
    grid-template-columns:360px minmax(600px, 1fr) !important; /* SP chỉnh khung đoạn chat bên phải PC tại đây */
    justify-content:center !important;
    align-items:stretch !important;
  }

  /* SP: PC danh sách trái không tự hiện nút Xoá khi rê chuột. */
  .contactPcChatPage .contactThreadDelete,
  .contactPcChatPage .contactThreadSwipe:hover .contactThreadDelete,
  .contactPcChatPage .contactThreadSwipe:focus-within .contactThreadDelete,
  .contactPcChatPage .contactThreadSwipe.is-open .contactThreadDelete{
    display:none !important;
    opacity:0 !important;
    pointer-events:none !important;
  }

  .contactPcChatPage .contactThreadSwipe__item{
    width:100% !important;
    transform:translate3d(0,0,0) !important;
  }

  .contactPcChatPage__room .contactChatSheet__bar{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
  }

  .contactPcChatPage__room .contactChatSheet__head{
    flex:1 1 auto !important;
    min-width:0 !important;
  }

  .contactPcChatPage__room .contactChatSheet__pcActions{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    gap:10px !important;
    position:relative !important;
    flex:0 0 auto !important;
  }

  .contactPcChatPage__room .contactChatSheet__close,
  .contactPcChatPage__room .contactChatSheet__pcMenu{
    appearance:none !important;
    -webkit-appearance:none !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:auto !important;
    min-width:0 !important;
    height:auto !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    color:#111 !important;
    font-size:26px !important;
    font-weight:600 !important;
    line-height:1 !important;
    cursor:pointer !important;
  }

  .contactPcChatPage__room .contactChatSheet__pcMenu{
    font-size:24px !important;
    transform:translateY(-1px);
  }

  .contactPcChatPage__room .contactChatSheet__pcDelete{
    position:absolute !important;
    right:0 !important;
    top:calc(100% + 10px) !important;
    z-index:8 !important;
    white-space:nowrap !important;
    border:1px solid rgba(0,0,0,.12) !important;
    border-radius:12px !important;
    background:#fff !important;
    color:#111 !important;
    box-shadow:0 10px 28px rgba(0,0,0,.14) !important;
    padding:10px 14px !important;
    font-size:16px !important;
    font-weight:588 !important;
    cursor:pointer !important;
  }

  .contactPcChatPage__room .contactChatSheet__pcDelete[hidden]{
    display:none !important;
  }

  .contactPcChatPage__room .contactMessageBlock{
    max-width:min(70%, 620px) !important;
  }

  .contactPcChatPage__room .contactChatImageGrid{
    width:min(420px, 70vw) !important;
  }
}

/* SP v426: canh giữa dấu + nút chat; mobile giảm độ đậm riêng, không đụng chức năng chat. */
.contactChatSheet__attach{
  align-items:center !important;
  justify-content:center !important;
  padding:0 !important;
  line-height:0 !important;
}
@media (max-width:1023px){
  .contactChatSheet__attach{
    font-weight:300 !important; /* SP: mobile giảm còn khoảng 1/2 độ đậm hiện tại */
    transform:translateY(-2px) !important; /* SP: kéo dấu + lên để cân giữa khung */
  }
}
@media (min-width:1024px){
  .contactChatSheet__attach{
    transform:translateY(-2px) !important; /* SP: PC chỉ canh giữa, không giảm độ đậm */
  }
}


/* SP v535: chỉnh riêng chat mobile - nút 3 gạch nằm chung hàng nút X, bỏ viền xám trên ô nhập, cắt khoảng trắng dư bàn phím. */
@media (max-width:899px){
  body.is-chat-room-route .contactChatSheet--route .contactChatSheet__bar{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:center !important;
    gap:10px !important;
    padding:calc(10px + env(safe-area-inset-top)) 14px 10px !important;
  }
  body.is-chat-room-route .contactChatSheet--route .contactChatSheet__head{
    min-width:0 !important;
  }
  body.is-chat-room-route .contactChatSheet--route .contactChatSheet__pcActions{
    display:inline-flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-end !important;
    gap:14px !important;
    position:relative !important;
    flex:0 0 auto !important;
  }
  body.is-chat-room-route .contactChatSheet--route .contactChatSheet__pcMenu,
  body.is-chat-room-route .contactChatSheet--route .contactChatSheet__close{
    appearance:none !important;
    -webkit-appearance:none !important;
    width:auto !important;
    min-width:0 !important;
    height:auto !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    color:#111 !important;
    font-size:26px !important;
    font-weight:600 !important;
    line-height:1 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  }
  body.is-chat-room-route .contactChatSheet--route .contactChatSheet__pcMenu{
    font-size:24px !important;
    transform:translateY(-1px) !important;
  }
  body.is-chat-room-route .contactChatSheet--route .contactChatSheet__composer{
    border-top:0 !important;
    padding:8px 10px 8px !important;
    margin:0 !important;
  }
}
