/* TZ v5 B-NEW — Multi-select через ПКМ-меню + bottom action-bar.
 *
 * Выделение запускается контекстным меню (правый клик), а не чекбоксом —
 * UX в духе Telegram. Подсвеченные сообщения получают amber-outline.
 */

.cw-msg[data-msg-idx] { position: relative; }

/* В selection-mode bubble становится кликабельным (toggle одним кликом). */
body.cw-ms-active .cw-msg[data-msg-idx] {
  cursor: pointer;
  transition: background 120ms ease;
}
body.cw-ms-active .cw-msg[data-msg-idx]:hover {
  background: rgba(245, 158, 11, 0.04);
  border-radius: 6px;
}
.cw-msg.is-ms-selected {
  outline: 1px solid rgba(245, 158, 11, 0.45);
  outline-offset: 4px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.04);
}

/* ─── Context menu by right-click ───────────────────────────────── */
.cw-ms-ctx-menu[hidden] { display: none; }
.cw-ms-ctx-menu {
  position: fixed;
  z-index: 9700;
  min-width: 220px;
  padding: 6px;
  background: #181b22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: cw-ms-ctx-pop 120ms ease;
}
@keyframes cw-ms-ctx-pop {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.cw-ms-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.86);
  font: 500 12.5px/1.2 inherit;
  text-align: left;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.cw-ms-ctx-item:hover {
  background: rgba(245, 158, 11, 0.12);
  color: rgba(255, 255, 255, 0.98);
}
.cw-ms-ctx-item-danger { color: rgba(254, 202, 202, 0.92); }
.cw-ms-ctx-item-danger:hover {
  background: rgba(239, 68, 68, 0.16);
  color: rgba(254, 202, 202, 1);
}
.cw-ms-ctx-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  font-size: 13px;
}
.cw-ms-ctx-sep {
  height: 1px;
  margin: 4px 6px;
  background: rgba(255, 255, 255, 0.06);
}

/* ─── Bottom action-bar ──────────────────────────────────────────── */
.cw-ms-actionbar[hidden] { display: none; }
.cw-ms-actionbar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 7500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(20, 22, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: cw-ms-slide-up 160ms ease;
}
@keyframes cw-ms-slide-up {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.cw-ms-count {
  padding: 0 6px 0 8px;
  font: 600 12px/1 inherit;
  color: rgba(245, 158, 11, 0.95);
  letter-spacing: 0.02em;
}
.cw-ms-btn {
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  font: 500 12px/1.2 inherit;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.cw-ms-btn:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.40);
  color: rgba(255, 255, 255, 0.98);
}
.cw-ms-btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
}
.cw-ms-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.95);
}
.cw-ms-btn-danger {
  border-color: rgba(239, 68, 68, 0.30);
  color: rgba(254, 202, 202, 0.92);
}
.cw-ms-btn-danger:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.55);
  color: rgba(254, 202, 202, 1);
}
