.scroll-y {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f5f7fb;
}

.scroll-y::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scroll-y::-webkit-scrollbar-track {
  background: #f5f7fb;
  border-radius: 10px;
}

.scroll-y::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 2px solid #f5f7fb;
}

.scroll-y::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.btn.tiny.gray {
  margin-left: auto;
  line-height: 1.05;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-8);
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}

.btn.newmsg:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.icon-btn {
  margin-left: auto;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-10);
  padding: 6px 8px;
  color: #475569;
}

.icon-btn.danger {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.icon-btn.icon-only {
  padding: 6px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}

.icon-btn.icon-only svg {
  width: 14px;
  height: 14px;
}

.icon-btn.danger.icon-only svg {
  color: #fff;
}

.icon-btn.icon-only:not(.danger) svg {
  color: #475569;
}

input,
select,
textarea,
#msg {
  color: #000 !important;
  caret-color: #000;
}

/* =========================
  COLUMN 1: USERS (ACTORS)
========================= */
.usersbar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#replaceBtn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-12);
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
}

#replaceBtn:hover {
  box-shadow: 0 4px 16px rgba(2, 6, 23, 0.06);
}

#replaceBtn .replace-ico {
  font-size: 18px;
  margin-right: 8px;
  color: #475569;
  transition: transform 0.12s, color 0.12s, opacity 0.12s;
}

#replaceBtn:hover .replace-ico {
  color: var(--brand-700);
  transform: rotate(-7deg);
}

#replaceBtn.spin .replace-ico {
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Totals block */
.numbers-kpi {
  display: flex;
  gap: 46px;
  align-items: center;
  padding: 6px 14px 4px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: rgb(240, 248, 255);
  margin-top: 13px;
  border-radius: 10px;
}

.numbers-kpi .kpi {
  min-width: 64px;
  text-align: center;
}

.numbers-kpi .lbl {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.numbers-kpi .val {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.numbers-kpi .val.ok {
  color: var(--green);
}

.numbers-kpi .val.bad {
  color: #ef4444;
}

/* =========================
  COLUMN 2: CONVERSATIONS
========================= */

.conv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.conv-title span {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.2px;
}

.add {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.add input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-pill);
  background: #f8fafc;
}

.thread {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-12);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.04);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.18s,
    transform 0.08s;
}

.thread:hover {
  background: #f8fafc;
  border-color: #93c5fd;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

.thread.active {
  background: #e0e7ff;
  border-color: #c7d2fe;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.15);
}

/* =========================
  COLUMN 3: CHAT
========================= */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.title {
  font-weight: 800;
}

#fetchStatus,
.muted.sm {
  font-size: 12px;
  color: var(--muted);
}

.banner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -9999px;
  opacity: 0;
  transition: all 0.2s;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.banner.show {
  top: 8px;
  opacity: 1;
}

.banner.error {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fecaca;
}

/* Bubbles */
.bubble {
  display: block;
  width: fit-content;
  max-width: 75%;
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 16px;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(2, 6, 23, 0.08);
  word-break: break-word;
  white-space: pre-wrap;
}

.bubble .content {
  margin-bottom: 6px;
}

.bubble .meta {
  font-size: 12px;
  opacity: 0.9;
  color: var(--muted);
}

.bubble .meta.right {
  text-align: right;
}

.bubble .meta.left {
  text-align: left;
}

.bubble.sent {
  margin-left: auto;
  background: var(--bubble-sent);
  color: var(--text);
  border: 1px solid var(--bubble-sent-br);
  border-bottom-right-radius: 8px;
}

.bubble.sent .meta {
  color: var(--bubble-sent-meta);
}
