/* ═══════════════════════════════════════════════════════
   SPARK — chats.css   Premium Chat Design System v1
   Glassmorphism, dual-pane layouts, and micro-interactions
   ═══════════════════════════════════════════════════════ */

/* Chat layout root inside the .mpanel */
.chat-container {
  display: flex;
  width: 100%;
  height: 100%;
  background: rgba(5, 6, 15, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: var(--tx);
  overflow: hidden;
  position: relative;
}



/* --- LEFT SIDEBAR (Directory) --- */
.chat-sidebar {
  width: 340px;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: rgba(5, 6, 15, 0.45);
}

.chat-sidebar-header {
  padding: 20px 20px 14px;
  flex-shrink: 0;
}

.chat-sidebar-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.chat-sidebar-title {
  font-family: var(--fh);
  font-size: 1.36rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--ac), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chat-sidebar-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ac);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.chat-sidebar-action:hover {
  background: var(--ac);
  color: var(--bg);
  transform: scale(1.05);
}

.chat-search-wrap {
  position: relative;
  width: 100%;
}
.chat-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mu);
  pointer-events: none;
}
.chat-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 12px 8px 30px;
  color: #fff;
  font-size: 0.86rem;
  transition: all 0.2s ease;
}
.chat-search-input:focus {
  border-color: var(--ac);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 10px rgba(var(--ac-rgb), 0.15);
}

/* Sidebar scrollable lists */
.chat-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 20px;
}

.chat-sidebar-section-title {
  font-family: var(--fh);
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--mu2);
  text-transform: uppercase;
  margin: 16px 10px 8px;
}

.chat-sidebar-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--mu2);
  font-size: 0.79rem;
  line-height: 1.6;
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.01);
  margin: 10px;
}

.chat-row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
  margin-bottom: 2px;
  position: relative;
}
.chat-row-item:hover {
  background: rgba(123, 92, 250, 0.08);
}
.chat-row-item.active {
  background: rgba(123, 92, 250, 0.15);
  border: 1px solid rgba(123, 92, 250, 0.22);
}

.chat-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
  display: flex;
}

.chat-status-dot {
  position: absolute;
  bottom: 0px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ac2);
  border: 2px solid rgba(15, 18, 36, 0.95);
  box-shadow: 0 0 8px var(--ac2);
  z-index: 2;
}
.chat-status-dot.offline {
  background: var(--mu);
  border-color: rgba(15, 18, 36, 0.95);
  box-shadow: none;
}

.chat-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.chat-item-info {
  flex: 1;
  min-width: 0;
}
.chat-item-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.chat-item-name {
  font-size: 0.93rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item-time {
  font-size: 0.71rem;
  color: var(--mu);
}
.chat-item-preview {
  font-size: 0.79rem;
  color: var(--mu2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.chat-badge-unread {
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--ac);
  color: var(--bg);
  font-size: 0.64rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(var(--ac-rgb), 0.35);
}

/* --- RIGHT VIEWPORT (Conversation) --- */
.chat-main-view {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg); /* solid theme background to prevent transparency! */
}

/* Placeholder for inactive view */
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}
.chat-empty-icon {
  font-size: 3.43rem;
  margin-bottom: 16px;
  opacity: 0.7;
  filter: drop-shadow(0 0 15px rgba(123, 92, 250, 0.4));
  animation: floatAnim 3s ease-in-out infinite;
}
@keyframes floatAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.chat-empty-title {
  font-family: var(--fh);
  font-size: 1.21rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.chat-empty-text {
  font-size: 0.86rem;
  color: var(--mu2);
  max-width: 320px;
  line-height: 1.5;
}

/* Chat Header */
.chat-main-header {
  height: 64px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: rgba(5, 6, 15, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 5;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-back-btn-mob {
  display: none; /* Desktop hidden */
  background: transparent;
  border: none;
  color: var(--mu2);
  cursor: pointer;
  padding: 4px;
  align-items: center;
  justify-content: center;
}

.chat-header-info {
  min-width: 0;
}
.chat-header-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.chat-header-status {
  font-size: 0.71rem;
  color: var(--ac2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.chat-header-status.offline {
  color: var(--mu);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-icon-btn {
  background: transparent;
  border: none;
  color: var(--mu2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.chat-header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Chat Messages Scroll Container */
.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* System Notifications */
.chat-system-message {
  align-self: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.75rem;
  color: var(--mu2);
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Message groups */
.chat-message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 70%;
  animation: chatReveal 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes chatReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-message-row.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.79rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  margin-bottom: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.chat-msg-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-msg-sender-name {
  font-size: 0.71rem;
  color: var(--mu2);
  margin-left: 6px;
  margin-bottom: -2px;
}
.chat-message-row.sent .chat-msg-sender-name {
  align-self: flex-end;
  margin-left: 0;
  margin-right: 6px;
}

.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--tx);
  font-size: 0.93rem;
  line-height: 1.45;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  position: relative;
  word-break: break-word;
}

.chat-message-row.sent .chat-msg-bubble {
  border-radius: 16px 16px 4px 16px;
  background: linear-gradient(135deg, rgba(var(--ac-rgb), 0.15), rgba(var(--ac2-rgb), 0.08));
  border: 1px solid rgba(var(--ac-rgb), 0.25);
  box-shadow: 0 4px 15px rgba(var(--ac-rgb), 0.08);
}

/* Premium gradient override for Cosmos theme styling */
.chat-message-row.sent .chat-msg-bubble {
  background: linear-gradient(135deg, rgba(123, 92, 250, 0.25), rgba(232, 90, 160, 0.15));
  border-color: rgba(123, 92, 250, 0.35);
}

.chat-msg-time {
  font-size: 0.64rem;
  color: var(--mu);
  align-self: flex-end;
  margin-top: 2px;
}

/* Message Emojis & Reactions popup */
.chat-msg-reactions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.chat-msg-react-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.71rem;
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--mu2);
}
.chat-msg-react-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.chat-msg-react-pill.active {
  background: rgba(123, 92, 250, 0.15);
  border-color: var(--vl);
  color: var(--ac);
}

/* Bubble click hover options popup */
.chat-bubble-context {
  position: absolute;
  top: -30px;
  right: 10px;
  background: rgba(15, 18, 36, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 6px;
  display: none;
  gap: 6px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  z-index: 10;
  animation: popIn 0.15s ease-out;
  white-space: nowrap; /* Prevent vertical emoji stacking in narrow bubbles */
  width: max-content !important;
  min-width: max-content !important;
}
.chat-bubble-delete-context {
  position: absolute;
  bottom: -32px;
  background: rgba(15, 18, 36, 0.95);
  border: 1px solid rgba(232, 90, 90, 0.3);
  border-radius: 8px;
  padding: 4px 10px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  z-index: 10;
  animation: popIn 0.15s ease-out;
  white-space: nowrap; /* Prevent text wrapping vertically in narrow bubbles */
  width: max-content !important;
  min-width: max-content !important;
}
@keyframes popIn {
  from { transform: scale(0.9) translateY(4px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
@media (hover: hover) {
  .chat-container:not(.pin-select-active) .chat-msg-bubble:hover .chat-bubble-context,
  .chat-container:not(.pin-select-active) .chat-msg-bubble:hover .chat-bubble-delete-context {
    display: flex;
  }
}
.chat-context-react-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  font-size: 0.93rem;
  transition: transform 0.2s;
}
.chat-context-react-btn:hover {
  transform: scale(1.22);
}

/* Rich media cards inside messages */
.chat-media-attachment-card {
  width: 250px;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  position: relative;
  background: rgba(0,0,0,0.25);
}
.chat-media-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.chat-media-meta {
  padding: 8px 12px;
  font-size: 0.79rem;
}
.chat-media-title {
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.chat-media-sub {
  color: var(--mu2);
  font-size: 0.68rem;
}

/* --- BOTTOM CHAT INPUT BAR --- */
.chat-main-input-container {
  padding: 16px 20px;
  background: rgba(5, 6, 15, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
}

/* Attachment options grid */
.chat-attachment-options-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-attachment-options-row::-webkit-scrollbar {
  display: none;
}

.chat-attach-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.79rem;
  color: var(--mu2);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.chat-attach-btn:hover {
  background: rgba(123, 92, 250, 0.08);
  border-color: rgba(123, 92, 250, 0.25);
  color: var(--ac);
}
.chat-attach-btn.selected {
  background: rgba(123, 92, 250, 0.15);
  border-color: var(--vl);
  color: var(--ac);
  box-shadow: 0 0 10px rgba(123, 92, 250, 0.2);
}

/* Text Input Row */
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 6px 6px 6px 14px;
  transition: border-color 0.2s, background 0.2s;
}
.chat-input-row:focus-within {
  border-color: var(--ac);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 12px rgba(var(--ac-rgb), 0.15);
}

.chat-text-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.93rem;
  /* БАГ #12: при глобальном box-sizing:border-box вертикальный padding 8px
     не помещался в height:20px и срезал/смещал placeholder ещё до ввода.
     Отступы даёт родительский .chat-input-row, textarea — чистые 20px строки. */
  padding: 0;
  line-height: 20px;
  outline: none;
  resize: none;
  height: 20px;
  font-family: inherit;
  max-height: 120px;
  overflow-y: auto;
}
.chat-text-input::placeholder {
  color: var(--mu2);
}

.message-text-block {
  white-space: pre-wrap !important;
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ac);
  border: none;
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(var(--ac-rgb), 0.35);
}
.chat-send-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 5px 15px rgba(var(--ac-rgb), 0.5);
}
.chat-send-btn:active {
  transform: translateY(0);
}

/* Preloaded attachment preview in composer input bar */
.chat-composed-attachment-preview {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 6px 10px;
  display: none;
  align-items: center;
  justify-content: space-between;
  font-size: 0.79rem;
  color: var(--ac2);
  border: 1px dashed rgba(var(--ac2-rgb), 0.3);
  animation: popIn 0.2s ease-out;
}
.chat-composed-attachment-preview span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}
.chat-cancel-attach-btn {
  background: transparent;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-weight: bold;
}

/* --- MOBILE SPECIFIC PANE OVERRIDES --- */
@media (max-width: 768px) {
  /* On mobile, Chats split layout shifts to sheet overlay system */
  .chat-sidebar {
    width: 100%;
    height: 100%;
    border-right: none;
  }
  
  .chat-main-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 10;
    display: none; /* Initially hidden */
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: #05060f !important; /* solid opaque background to cover the sidebar! */
  }

  .chat-main-input-container {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)) !important;
  }
  
  .chat-main-view.open-active {
    display: flex;
    transform: translateX(0);
  }
  
  .chat-back-btn-mob {
    display: flex; /* Mobile visible */
  }

  .chat-messages-area {
    padding: 16px;
  }
  .chat-message-row {
    max-width: 82%;
  }
}

/* --- Desktop/PC Specific Panel Support --- */
@media (min-width: 769px) {
  .mpanel {
    display: none;
    position: fixed;
    inset: 62px 0 0 0;
    z-index: 400;
    background: var(--bg);
    overflow: hidden;
    padding: 0 !important; /* Clear padding for full-bleed premium dual-pane chat */
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s var(--ease-enter), opacity 0.3s ease, visibility 0.3s ease;
  }
  .mpanel.open {
    display: block !important;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.chat-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-family: var(--fh);
  font-size: 0.57rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bg);
  box-shadow: 0 0 8px rgba(232, 90, 90, 0.4);
  z-index: 10;
}

/* Adjust mobile icon unread badge positioning */
.m-ic .chat-badge-count {
  top: -6px;
  right: -6px;
}

/* Premium reaction alignments (left for sent, right for received) */
.chat-message-row.sent .chat-msg-reactions {
  align-self: flex-start;
}
.chat-message-row:not(.sent) .chat-msg-reactions {
  align-self: flex-end;
}

/* Hover context menu placement to prevent clipping with avatar or message text */
.chat-message-row.sent .chat-bubble-context,
.chat-message-row.sent .chat-bubble-delete-context {
  right: 10px;
  left: auto;
}
.chat-message-row:not(.sent) .chat-bubble-context,
.chat-message-row:not(.sent) .chat-bubble-delete-context {
  left: 10px;
  right: auto;
}

/* Extra context actions styling */
.chat-context-picker-btn, .chat-context-delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  font-size: 0.93rem;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-context-picker-btn:hover, .chat-context-delete-btn:hover {
  transform: scale(1.22);
}

/* Delete confirmation modal buttons styling */
.chat-delete-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.chat-delete-modal-buttons button {
  flex: 1;
  flex-shrink: 0;
  min-width: 0;
  padding: 12px 20px !important;
  border-radius: 12px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  height: 46px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  align-self: center !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
@media (max-width: 576px) {
  .chat-delete-modal-buttons {
    flex-direction: column-reverse;
    gap: 10px;
  }
  .chat-delete-modal-buttons button {
    width: 100% !important;
  }
}

/* Search highlighters & scroll effects */
.search-highlight {
  background: rgba(232, 197, 90, 0.45) !important;
  color: #fff !important;
  border-radius: 4px;
  padding: 0 2px;
  box-shadow: 0 0 10px rgba(232, 197, 90, 0.45);
}

@keyframes searchGlowPulse {
  0% { box-shadow: 0 0 0 rgba(232, 197, 90, 0); }
  50% { box-shadow: 0 0 25px rgba(232, 197, 90, 0.7); background: rgba(232, 197, 90, 0.15) !important; }
  100% { box-shadow: 0 0 0 rgba(232, 197, 90, 0); }
}
.search-pulse-glow .chat-msg-bubble {
  animation: searchGlowPulse 1.5s ease-in-out;
}

/* Pinned message selections */
.chat-message-row.pin-selected .chat-msg-bubble {
  border-color: var(--ac) !important;
  box-shadow: 0 0 15px rgba(123, 92, 250, 0.45) !important;
  transform: scale(1.02);
  transition: all 0.25s var(--ease-smooth);
}

/* --- V3 PREMIUM MULTI-SELECT OVERLAYS --- */
.chat-custom-checkbox {
  width: 20px !important;
  height: 20px !important;
  border-radius: 7px !important; /* Squircle */
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  background: rgba(15, 18, 36, 0.5) !important; /* Dark theme-compliant glassmorphism */
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.24s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4) !important;
  flex-shrink: 0 !important;
  user-select: none !important;
}
.chat-row-item:hover .chat-custom-checkbox {
  border-color: rgba(123, 92, 250, 0.5) !important;
  box-shadow: 0 0 10px rgba(123, 92, 250, 0.25) !important;
}
.chat-custom-checkbox.checked {
  background: linear-gradient(135deg, #7B5CFA 0%, #E85AA0 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 0 14px rgba(123, 92, 250, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}
.chat-checkbox-tick {
  color: #fff !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

#chatMultiSelectBar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: rgba(15, 18, 36, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 8px 12px !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.05) !important;
  margin-bottom: 12px !important;
  animation: slideDownIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes slideDownIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.chat-multiselect-count {
  font-size: 0.86rem !important;
  font-weight: 800 !important;
  color: #fff !important;
  font-family: var(--fh) !important;
  letter-spacing: 0.03em !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2) !important;
}

.chat-multiselect-btn {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important; /* Sleek Squircle Buttons */
  padding: 6px 12px !important;
  font-size: 0.79rem !important;
  font-weight: 700 !important;
  color: var(--tx) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  font-family: var(--fh) !important;
  backdrop-filter: blur(4px) !important;
}
.chat-multiselect-btn-pin {
  background: rgba(123, 92, 250, 0.12) !important;
  border-color: rgba(123, 92, 250, 0.3) !important;
  color: #cbbffd !important;
}
.chat-multiselect-btn-pin:hover {
  background: linear-gradient(135deg, rgba(123, 92, 250, 0.35) 0%, rgba(232, 90, 160, 0.2) 100%) !important;
  border-color: rgba(123, 92, 250, 0.6) !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(123, 92, 250, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-1px) !important;
}
.chat-multiselect-btn-pin:active {
  transform: translateY(0) !important;
}
.chat-multiselect-btn-delete {
  background: rgba(232, 90, 90, 0.12) !important;
  border-color: rgba(232, 90, 90, 0.3) !important;
  color: #ffb3b3 !important;
}
.chat-multiselect-btn-delete:hover {
  background: linear-gradient(135deg, rgba(232, 90, 90, 0.35) 0%, rgba(232, 90, 160, 0.2) 100%) !important;
  border-color: rgba(232, 90, 90, 0.6) !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(232, 90, 90, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-1px) !important;
}
.chat-multiselect-btn-delete:active {
  transform: translateY(0) !important;
}
.chat-multiselect-btn-cancel {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--mu2) !important;
  padding: 6px 12px !important;
  border-radius: 10px !important;
}
.chat-multiselect-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15) !important;
  transform: translateY(-1px) !important;
}
.chat-multiselect-btn-cancel:active {
  transform: translateY(0) !important;
}
