.scroll-y {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--wa-scroll-thumb) var(--wa-scroll-track);
}

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

.scroll-y::-webkit-scrollbar-track {
  background: var(--wa-scroll-track);
  border-radius: 10px;
}

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

.scroll-y::-webkit-scrollbar-thumb:hover {
  background: var(--wa-scroll-thumb-hover);
}

.btn.tiny.gray {
  margin-left: auto;
  line-height: 1.05;
  padding: 8px 10px;
  border: 1px solid var(--wa-border);
  border-radius: var(--radius-8);
  background: var(--wa-topbar);
  color: var(--wa-text);
  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: var(--wa-surface);
  border-radius: var(--radius-10);
  padding: 6px 8px;
  color: var(--wa-muted);
}

.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: var(--wa-muted);
}

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

.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: var(--wa-surface);
  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: var(--wa-muted);
  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);
  }
}
.numbers-kpi {
  display: flex;
  gap: 12px;
  align-items: center;

  margin-top: 13px;
  padding: 10px;

  background: var(--wa-card-bg);
  border: 1px solid var(--wa-border);
  border-radius: var(--ui-r);
}

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

  background: var(--wa-chat-bg);
  border: 1px solid var(--wa-border);
  border-radius: var(--ui-r-sm);
  padding: 10px;
}

.numbers-kpi .lbl {
  color: var(--wa-muted);
}
.numbers-kpi .val {
  color: var(--wa-text);
}

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

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


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

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

.add {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--wa-border);
  background: var(--wa-chat-bg);
}

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

.thread {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-12);
  background: var(--wa-surface);
  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: var(--wa-topbar);
  border-color: rgba(18, 140, 126, 0.35);
  box-shadow: 0 10px 26px rgba(18, 140, 126, 0.12);
  transform: translateY(-1px);
}

.thread.active {
  background: var(--wa-active);
  border-color: rgba(18, 140, 126, 0.25);
  box-shadow: 0 10px 26px rgba(18, 140, 126, 0.14);
}

.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--wa-border);
  background: var(--wa-surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.title {
  font-weight: 800;
}

#fetchStatus,
.muted.sm {
  font-size: 12px;
  color: var(--wa-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;
}

.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(--wa-muted);
}

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

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

.bubble.sent {
  margin-left: auto;
  background: var(--wa-bubble-out);
  color: var(--wa-text);
  border: 1px solid rgba(17, 27, 33, 0.08);
  border-bottom-right-radius: 8px;
}

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