/* App sidebar + header must stay above any messages overlay */
.flex.h-screen > aside {
  position: relative;
  z-index: 50;
  flex-shrink: 0 !important;
}

.flex.h-screen > .flex-1.flex.flex-col.min-w-0 > header {
  position: relative;
  z-index: 45;
}

.influnet-biz-msgs-standalone {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #f5f6fa;
  overflow: hidden;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.infl-business-messages-view .influnet-biz-msgs-standalone {
  display: flex !important;
}

.infl-biz-msgs-layout {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.infl-biz-msgs-sidebar {
  width: 18rem;
  border-right: 1px solid #f3f4f6;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.infl-biz-msgs-sidebar-head {
  padding: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.infl-biz-msgs-sidebar-head h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
}

.infl-biz-msgs-list {
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
}

.infl-biz-msgs-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-bottom: 1px solid #f9fafb;
}

.infl-biz-msgs-item:hover {
  background: #f9fafb;
}

.infl-biz-msgs-item.is-active {
  background: #f5f3ff;
}

.infl-biz-msgs-item-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

.infl-biz-msgs-item-preview {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.infl-biz-msgs-item-time {
  display: block;
  font-size: 0.625rem;
  color: #d1d5db;
  margin-top: 0.2rem;
}

.infl-biz-msgs-muted {
  padding: 1rem;
  font-size: 0.875rem;
  color: #9ca3af;
  margin: 0;
}

.infl-biz-msgs-thread {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(249, 250, 251, 0.6);
}

.infl-biz-msgs-thread-head {
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
}

.infl-biz-msgs-thread-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

.infl-biz-msgs-thread-status {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #9ca3af;
}

.infl-biz-msgs-empty-thread {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.875rem;
}

.infl-biz-msgs-bubbles {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.infl-biz-msgs-bubble.is-grouped {
  margin-top: -0.25rem;
}

.infl-biz-msgs-bubble {
  max-width: 24rem;
  border-radius: 1rem;
  padding: 0.625rem 1rem;
}

.infl-biz-msgs-bubble.is-me {
  align-self: flex-end;
  background: #7c3aed;
  color: #fff;
}

.infl-biz-msgs-bubble.is-them {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #f3f4f6;
  color: #1f2937;
}

.infl-biz-msgs-bubble p {
  margin: 0;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.infl-biz-msgs-bubble time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.625rem;
  opacity: 0.75;
}

.infl-biz-msgs-compose {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-top: 1px solid #f3f4f6;
}

.infl-biz-msgs-compose input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.infl-biz-msgs-compose button {
  border: 0;
  border-radius: 0.75rem;
  background: #7c3aed;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.infl-biz-msgs-compose button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.infl-biz-msgs-error {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: #dc2626;
}

/* Influencer React chat: stay inside main, never overlap app sidebar */
.influnet-react-messages-root {
  overflow: hidden !important;
  max-width: 100% !important;
}
