:root {
  --teal-dark: #075e54;
  --teal: #128c7e;
  --green: #25d366;
  --bubble-out: #dcf8c6;
  --bubble-in: #ffffff;
  --bg-chat: #e5ddd5;
  --bg-app: #f0f2f5;
  --text-dark: #111b21;
  --text-muted: #667781;
  --border: #e9edef;
  --danger: #e53935;
  --header-height: 64px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-app);
  color: var(--text-dark);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- App shell ---------- */

.app-shell {
  max-width: 1200px;
  margin: 16px auto;
  height: calc(100vh - 32px);
  min-height: 560px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-panes {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ---------- Sidebar (chat list) ---------- */

.sidebar {
  width: 380px;
  min-width: 280px;
  max-width: 45%;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: #fff;
}

.topbar {
  background: var(--teal-dark);
  color: #fff;
  height: var(--header-height);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-sizing: border-box;
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.topbar-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.topbar-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar .icon-btn,
.conversation-header .icon-btn {
  background: none;
  border: none;
  color: #fff;
  opacity: 0.9;
}

.search-box {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.search-box input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-app);
  font-size: 14px;
  outline: none;
}

.filter-pills {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.filter-pills button {
  border: 1px solid var(--border);
  background: var(--bg-app);
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-dark);
}

.filter-pills button.active {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #fff;
}

.chat-list {
  overflow-y: auto;
  flex: 1;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.chat-item:hover,
.chat-item.active {
  background: var(--bg-app);
}

.chat-item.pinned {
  background: #fbfaf7;
}

.chat-item.pinned:hover,
.chat-item.pinned.active {
  background: var(--bg-app);
}

.chat-item .meta {
  flex: 1;
  min-width: 0;
}

.chat-item .row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.row-top-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.pin-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  opacity: 0.35;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  flex-shrink: 0;
}

.chat-item:hover .pin-toggle-btn,
.pin-toggle-btn.pinned {
  opacity: 1;
}

.pin-toggle-btn.pinned {
  color: var(--teal-dark);
}

.chat-item .name {
  font-weight: 600;
  font-size: 15px;
}

.chat-item .time {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chat-item .row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.chat-item .preview {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unread-badge {
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}

.empty-hint {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Avatars ---------- */

.avatar-circle {
  border-radius: 50%;
  color: #fff;
  text-align: center;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-img {
  object-fit: cover;
  display: block;
  background: var(--bg-app);
}

/* ---------- Conversation pane ---------- */

.conversation {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-chat);
  min-width: 0;
  position: relative;
}

.conversation-header {
  background: var(--teal-dark);
  color: #fff;
  height: var(--header-height);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.conversation-header .back-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
}

.conversation-header .who {
  flex: 1;
  min-width: 0;
}

.conversation-header .who .name {
  font-weight: 600;
  font-size: 15px;
}

.conversation-header .who .status {
  font-size: 12px;
  opacity: 0.85;
}

.header-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.header-menu {
  position: absolute;
  top: 40px;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
  padding: 6px;
  min-width: 150px;
  z-index: 25;
}

.header-menu button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-dark);
}

.header-menu button:hover {
  background: var(--bg-app);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 6%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bubble {
  max-width: 65%;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
  word-wrap: break-word;
  position: relative;
}

.bubble-menu-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 5;
  background: none;
  border: none;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.1s;
}

.bubble:hover .bubble-menu-btn,
.bubble-menu-btn:focus {
  opacity: 1;
}

.bubble-menu-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.bubble.has-media .bubble-menu-btn {
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0.9;
}

.bubble-menu {
  position: absolute;
  width: 180px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
  padding: 6px;
  z-index: 30;
}

.bubble-menu button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-dark);
}

.bubble-menu button:hover {
  background: var(--bg-app);
}

.bubble.deleted {
  background: #f0f0ee;
  box-shadow: none;
}

.deleted-text {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

/* ---------- Bot quick-reply buttons ---------- */

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 65%;
  margin-top: -2px;
  margin-bottom: 4px;
}

.quick-replies.out {
  align-self: flex-end;
}

.quick-replies.in {
  align-self: flex-start;
}

.quick-reply-btn {
  background: #fff;
  border: 1px solid var(--teal);
  color: var(--teal-dark);
  border-radius: 16px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.quick-reply-btn:hover {
  background: var(--teal);
  color: #fff;
}

.bubble.in {
  align-self: flex-start;
  background: var(--bubble-in);
  border-top-left-radius: 0;
}

.bubble.out {
  align-self: flex-end;
  background: var(--bubble-out);
  border-top-right-radius: 0;
}

.bubble.has-media {
  padding: 4px;
  max-width: 45%;
}

.image-wrap {
  position: relative;
}

.chat-image {
  display: block;
  width: 100%;
  border-radius: 6px;
  max-height: 320px;
  object-fit: cover;
}

.image-download-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 0.1s, background 0.1s;
}

.image-download-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  opacity: 1;
}

.bubble.has-media .bubble-text {
  padding: 5px 6px 0;
}

.bubble.has-media .time {
  padding: 0 6px 3px;
}

.bubble .time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ticks {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 12px;
  color: #8696a0;
  flex-shrink: 0;
}

.ticks.read {
  color: #53bdeb;
}

.ticks svg {
  position: absolute;
  top: 0;
  width: 12px;
  height: 12px;
}

.ticks svg.tick1 {
  left: 0;
}

.ticks svg.tick2 {
  left: 4px;
}

.composer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f0f2f5;
  flex-shrink: 0;
}

.composer input[type="text"] {
  flex: 1;
  padding: 11px 16px;
  border-radius: 20px;
  border: none;
  outline: none;
  font-size: 14px;
}

.composer .send-btn {
  background: var(--teal-dark);
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.composer-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
}

.composer-icon:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--teal-dark);
}

/* ---------- Emoji picker ---------- */

.emoji-panel {
  position: absolute;
  bottom: 66px;
  left: 16px;
  width: 300px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  padding: 8px 10px;
  z-index: 20;
}

.emoji-group-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 6px 2px 4px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.emoji-option {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  padding: 5px;
  border-radius: 6px;
  cursor: pointer;
}

.emoji-option:hover {
  background: var(--bg-app);
}

/* ---------- Attach preview strip (image / video / file) ---------- */

.attach-preview-strip {
  padding: 10px 16px 0;
  background: #f0f2f5;
}

.attach-preview-thumb {
  position: relative;
  display: inline-block;
}

.attach-preview-thumb img,
.attach-preview-thumb video {
  max-height: 90px;
  max-width: 140px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  background: #000;
}

.attach-preview-file {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  max-width: 220px;
  color: var(--text-dark);
}

.attach-preview-file span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attach-preview-thumb button {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-dark);
  color: #fff;
  border: 2px solid #fff;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attach-progress-overlay {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
}

.attach-progress-bar {
  width: 80%;
  height: 5px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  overflow: hidden;
}

.attach-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  transition: width 0.15s ease;
}

.attach-progress-pct {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

/* ---------- Attach menu ("+" popup) ---------- */

.attach-menu {
  position: absolute;
  bottom: 66px;
  left: 16px;
  width: 220px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  padding: 6px;
  z-index: 20;
}

.attach-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dark);
  text-align: left;
}

.attach-menu-item:hover {
  background: var(--bg-app);
}

.attach-menu-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.attach-menu-icon.bg-purple {
  background: #7f66ff;
}

.attach-menu-icon.bg-blue {
  background: #4a9de8;
}

.attach-menu-icon.bg-pink {
  background: #e84a8a;
}

/* ---------- Video + file bubbles ---------- */

.chat-video {
  display: block;
  width: 100%;
  max-height: 320px;
  border-radius: 6px;
  background: #000;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-dark);
}

.file-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--teal-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-card-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.no-conversation {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
  padding: 20px;
}

/* ---------- Bottom nav ---------- */

.bottom-nav {
  display: flex;
  border-top: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 0 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.bottom-nav a.active {
  color: var(--teal-dark);
}

.bottom-nav svg {
  width: 22px;
  height: 22px;
}

/* ---------- Single-panel pages (contacts / settings) ---------- */

.panel {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

.panel-search {
  padding: 10px 16px;
}

.contact-group-label {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  background: var(--bg-app);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.contact-row:hover {
  background: var(--bg-app);
}

.contact-row .name {
  font-weight: 600;
  font-size: 15px;
}

.contact-row .status {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Settings ---------- */

.settings-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.settings-profile .name {
  font-size: 18px;
  font-weight: 700;
}

.settings-profile .username {
  color: var(--text-muted);
  font-size: 13px;
}

.avatar-edit-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.avatar-camera-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--teal-dark);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-avatar-link {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  margin-top: 4px;
}

/* ---------- Avatar crop modal ---------- */

.crop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.crop-dialog {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 320px;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.crop-dialog h2 {
  font-size: 16px;
  margin: 0 0 16px;
  color: var(--text-dark);
}

.crop-viewport {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: #222;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 4px var(--bg-app);
}

.crop-viewport:active {
  cursor: grabbing;
}

.crop-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
}

#cropZoom {
  width: 100%;
  margin: 18px 0 6px;
  accent-color: var(--teal-dark);
}

.crop-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.crop-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
}

.crop-cancel-btn {
  background: var(--bg-app);
  color: var(--text-dark);
}

.crop-save-btn {
  background: var(--teal-dark);
  color: #fff;
}

.crop-save-btn:disabled {
  opacity: 0.6;
}

.settings-row {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.settings-row .k {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 2px;
}

.row-value-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row-value {
  overflow-wrap: anywhere;
}

.row-value.empty {
  color: var(--text-muted);
  font-style: italic;
}

.edit-field-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  flex-shrink: 0;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-field-btn:hover {
  color: var(--teal-dark);
}

.field-edit-area {
  width: 100%;
}

.field-edit-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--teal);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.field-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.field-save-btn,
.field-cancel-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: none;
}

.field-save-btn {
  background: var(--teal-dark);
  color: #fff;
}

.field-save-btn:disabled {
  opacity: 0.6;
}

.field-cancel-btn {
  background: var(--bg-app);
  color: var(--text-dark);
}

.field-edit-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
}

.logout-btn {
  margin: 20px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid var(--danger);
  color: var(--danger);
  background: none;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Auth pages ---------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  padding: 32px 28px;
}

.auth-logo {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  margin: 0 auto 12px;
}

.auth-card .brand {
  text-align: center;
  color: var(--teal-dark);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-card .tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.auth-card label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

.auth-card input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  outline: none;
}

.auth-card input:focus {
  border-color: var(--teal);
}

.auth-card .submit-btn {
  width: 100%;
  margin-top: 22px;
  padding: 12px;
  background: var(--teal-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
}

.auth-card .switch-link {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-card .switch-link a {
  color: var(--teal);
  font-weight: 600;
}

.auth-error {
  background: #fdecea;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 16px;
}

.demo-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-app);
  border-radius: 8px;
  padding: 8px 10px;
}

/* ---------- Responsive: collapse to single column ---------- */

@media (max-width: 820px) {
  .app-shell {
    margin: 0;
    height: 100vh;
    border-radius: 0;
  }

  .sidebar {
    width: 100%;
    max-width: 100%;
  }

  .main-panes.has-active:not(.single-panel) .sidebar {
    display: none;
  }

  .main-panes:not(.has-active) .conversation {
    display: none;
  }

  .conversation-header .back-btn {
    display: inline-block;
  }

  .bubble {
    max-width: 80%;
  }
}

/* ---------- Groups ---------- */

.who-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  color: #fff;
}

.sender-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 2px;
}

.new-group-form {
  padding: 16px;
}

.new-group-form input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 15px;
  outline: none;
}

.new-group-form input[type="text"]:focus {
  border-color: var(--teal);
}

.member-picker-hint {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  background: var(--bg-app);
}

.member-picker-row {
  cursor: pointer;
}

.member-picker-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 4px;
  accent-color: var(--teal-dark);
}

.new-group-submit {
  display: block;
  width: calc(100% - 32px);
  margin: 16px;
  padding: 12px;
  background: var(--teal-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
}

.group-add-members {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.role-badge {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.remove-member-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  flex-shrink: 0;
}
