.chat-workspace-body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--neutral);
}

.workspace-viewport {
  flex: 1;
  display: flex;
  overflow: hidden;
  height: calc(100vh - 65px);
  position: relative;
}

/* Sidebar */
.chat-sidebar {
  width: 280px;
  background-color: var(--white);
  border-right: 1px solid rgba(26, 46, 53, 0.08);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.sidebar-list-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conversation-row-item {
  padding: 12px;
  border-radius: 6px;
  background-color: var(--neutral);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}
.conversation-row-item:hover,
.conversation-row-item.active {
  border-color: var(--primary);
  background-color: var(--tertiary);
  color: var(--primary);
}

.sidebar-promo-box {
  background-color: var(--tertiary);
  padding: 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--secondary);
  border: 1px dashed var(--primary);
}

/* Sidebar toggle button — hidden on desktop */
.sidebar-toggle-btn {
  display: none;
  position: fixed;
  bottom: 90px;
  left: 16px;
  z-index: 200;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Overlay behind sidebar on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
}
.sidebar-overlay.active {
  display: block;
}

/* Main chat area */
.chat-main-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--neutral);
  position: relative;
  min-width: 0;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Bubbles */
.message-bubble {
  max-width: 75%;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;
}
.message-bubble.user {
  background-color: var(--primary);
  color: var(--neutral);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.message-bubble.assistant {
  background-color: var(--white);
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(26, 46, 53, 0.06);
}
.message-bubble.crisis-intervention {
  border: 2px solid #f8b4b4;
  background-color: #fff5f5;
}

/* Input dock */
.chat-input-sticky-dock {
  padding: 16px 30px 24px 30px;
  background-color: var(--neutral);
}
.chat-form-raw {
  display: flex;
  background-color: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px;
}
.chat-form-raw input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 14px;
  font-size: 1rem;
  background: transparent;
  min-width: 0;
}
.chat-send-btn {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  padding: 0 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}
.chat-send-btn:hover {
  background-color: #122117;
}

.chat-disclaimer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Typing animation */
.typing-skeleton {
  display: flex;
  gap: 5px;
  padding: 8px;
}
.typing-dot {
  width: 8px;
  height: 8px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* ============================================================
   RESPONSIVE — Mobile (max 768px)
   ============================================================ */
@media (max-width: 768px) {
  /* Sidebar slides in as drawer from the left */
  .chat-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 160;
    transform: translateX(-100%);
    width: 280px;
    padding-top: 60px;
  }
  .chat-sidebar.open {
    transform: translateX(0);
  }

  /* Show the floating toggle button */
  .sidebar-toggle-btn {
    display: flex;
  }

  .chat-messages-container {
    padding: 16px;
    gap: 12px;
  }

  .message-bubble {
    max-width: 88%;
    font-size: 0.9rem;
    padding: 12px 14px;
  }

  .chat-input-sticky-dock {
    padding: 12px 16px 20px 16px;
  }

  .chat-form-raw input {
    font-size: 0.95rem;
    padding: 10px 10px;
  }

  .chat-disclaimer {
    font-size: 0.7rem;
  }
}
