/* ========== CHAT PAGE ENHANCED STYLES ========== */

/* --- Chat Page Header --- */

.chat-page-header {
  margin-bottom: 0;
}

.chat-page-header h3 {
  position: relative;
  display: inline-block;
}

.chat-page-subtitle {
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
  margin-top: 2px;
  font-weight: 400;
}

/* --- Chat List Panel --- */

.chat-list-panel {
  background: var(--bs-body-bg);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--bs-border-color-translucent);
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 700px;
}

[data-bs-theme="dark"] .chat-list-panel {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* --- Search Area --- */

.chat-search-area {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

/* --- Action bar (export etc.) --- */

.chat-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}

.chat-action-bar .btn {
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  transition: all 0.2s ease;
}

.chat-action-bar .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(var(--bs-primary-rgb), 0.2);
}

/* --- Chat List Scrollable Container --- */

.chat-list-scroll {
  flex: 1;
  overflow-y: auto;
  margin: 0 -8px;
  padding: 0 8px;
  height: 100%;
}

.chat-list-scroll::-webkit-scrollbar {
  width: 5px;
}

.chat-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.chat-list-scroll::-webkit-scrollbar-thumb {
  background: var(--bs-border-color);
  border-radius: 10px;
}

.chat-list-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--bs-secondary-color);
}

/* --- Read Filter (inline next to search) --- */

.chat-read-filter-inline {
  width: auto;
  min-width: 100px;
  font-size: 0.95rem;
  border-radius: 8px;
  flex-shrink: 0;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  height: 100%;
}

/* --- Unread Dot --- */

.unread-dot {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bs-primary);
  border: 2px solid var(--bs-body-bg);
  z-index: 2;
  pointer-events: none;
}

/* --- Chat List Item --- */

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  background: transparent;
}

.chat-list-item:hover {
  background: var(--bs-primary-bg-subtle);
  border-color: rgba(var(--bs-primary-rgb), 0.15);
}

.chat-list-item.active {
  background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.08), rgba(var(--bs-primary-rgb), 0.04));
  border-color: rgba(var(--bs-primary-rgb), 0.2);
  box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.1);
}

/* Channel Icon */

.chat-list-item .channel-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
}

.chat-list-item .channel-icon.channel-web {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  color: #1565c0;
}

.chat-list-item .channel-icon.channel-instagram {
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  color: #c2185b;
}

.chat-list-item .channel-icon.channel-facebook {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  color: #1565c0;
}

.chat-list-item .channel-icon.channel-whatsapp {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  color: #2e7d32;
}

[data-bs-theme="dark"] .chat-list-item .channel-icon.channel-web {
  background: linear-gradient(135deg, #1a3a5c, #1a3a5c88);
}

[data-bs-theme="dark"] .chat-list-item .channel-icon.channel-instagram {
  background: linear-gradient(135deg, #5c1a2d, #5c1a2d88);
}

[data-bs-theme="dark"] .chat-list-item .channel-icon.channel-facebook {
  background: linear-gradient(135deg, #1a3a5c, #1a3a5c88);
}

[data-bs-theme="dark"] .chat-list-item .channel-icon.channel-whatsapp {
  background: linear-gradient(135deg, #1a3d1e, #1a3d1e88);
}

/* Chat Item Info */

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

.chat-list-item .chat-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--bs-body-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.chat-list-item .chat-item-date {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Checkbox */

.chat-list-item .form-check-input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 6px !important;
  cursor: pointer;
}

/* Chat count footer */

.chat-list-count {
  padding-top: 12px;
  border-top: 1px solid var(--bs-border-color-translucent);
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
  text-align: center;
  font-weight: 500;
}

/* --- Chat Messages Panel --- */

.chat-messages-panel {
  height: 700px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--bs-border-color-translucent);
  background: var(--bs-body-bg);
  display: flex;
  flex-direction: column;
}

.mobile-chat-close {
  display: none;
}

.voice-mobile-call-context {
  display: none;
}

[data-bs-theme="dark"] .chat-messages-panel {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Override wrapper inside panel */

.chat-messages-panel .agent-widget-chat-view {
  box-shadow: none;
  border: none;
  border-radius: 0;
}

/* Use primary color for chat header gradient */

.chat-messages-panel .agent-widget-header {
  background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 70%, #000));
  padding: 18px 24px;
}

[data-bs-theme="dark"] .chat-messages-panel .agent-widget-header {
  background: linear-gradient(135deg, color-mix(in srgb, var(--bs-primary) 60%, #000), color-mix(in srgb, var(--bs-primary) 40%, #000));
}

.chat-messages-panel .agent-widget-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chat-messages-panel .chat-info {
  gap: 16px;
  font-size: 0.78rem;
  opacity: 0.85;
}

/* User message bubble — matches primary theme */

.chat-messages-panel .message.user {
  background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 70%, #000));
  box-shadow: 0 2px 10px rgba(var(--bs-primary-rgb), 0.2);
}

[data-bs-theme="dark"] .chat-messages-panel .message.user {
  background: linear-gradient(135deg, color-mix(in srgb, var(--bs-primary) 70%, #000), color-mix(in srgb, var(--bs-primary) 50%, #000));
  box-shadow: 0 2px 10px rgba(var(--bs-primary-rgb), 0.15);
}

/* Assistant message bubble */

.chat-messages-panel .message.assistant {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .chat-messages-panel .message.assistant {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}

/* Handoff send button — matches theme */

.chat-messages-panel .handoff-send-btn {
  background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 70%, #000));
}

.chat-messages-panel .handoff-send-btn:hover {
  box-shadow: 0 4px 14px rgba(var(--bs-primary-rgb), 0.3);
}

/* Status bar refinements */

.chat-messages-panel .handoff-status-bar {
  padding: 10px 20px;
  font-size: 0.85rem;
}

.chat-messages-panel .handoff-input-area {
  padding: 14px 20px;
}

.chat-messages-panel .handoff-input {
  border-radius: 14px;
  font-size: 0.9rem;
}

.chat-messages-panel .handoff-input:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.12);
}

/* --- Empty state in chat list --- */

.chat-list-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--bs-secondary-color);
}

.chat-list-empty-state .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.chat-list-empty-state p {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--bs-body-color);
}

.chat-list-empty-state small {
  font-size: 0.8rem;
}

/* --- No chat selected placeholder --- */

.chat-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--bs-secondary-color);
  text-align: center;
  padding: 40px;
}

.chat-placeholder .placeholder-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 20px;
  opacity: 0.7;
}

.chat-placeholder p {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--bs-body-color);
  margin-bottom: 4px;
}

.chat-placeholder small {
  font-size: 0.85rem;
}

/* --- Voice call channel icon dark mode --- */

[data-bs-theme="dark"] .chat-list-item .channel-icon[style*="e8f5e9"] {
  background: linear-gradient(135deg, #1a3d1e, #1a3d1e88) !important;
}

[data-bs-theme="dark"] .chat-list-item .channel-icon[style*="e3f2fd"] {
  background: linear-gradient(135deg, #1a3a5c, #1a3a5c88) !important;
}

/* --- Mobile Responsive --- */

@media (max-width: 768px) {
  body.mobile-chat-modal-open {
    overflow: hidden;
  }

  body.mobile-voice-call-modal-open {
    overflow: hidden;
  }

  .voice-desktop-call-details {
    display: none !important;
  }

  #agentInfoListChatDiv.chat-action-bar {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    gap: 6px;
    overflow: hidden;
    box-sizing: border-box;
  }

  #agentInfoListChatDiv #chatSelCount {
    display: none;
  }

  #agentInfoListChatDiv .btn {
    display: inline-flex;
    min-width: 0;
    max-width: calc(50% - 3px);
    flex: 1 1 calc(50% - 3px);
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    padding-right: 8px;
    padding-left: 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  #agentInfoListChatDiv .btn span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  #chatSelectAllBar {
    max-width: 100%;
    flex-wrap: wrap;
    overflow: hidden;
  }

  #chatSelectAllInfo {
    min-width: 0;
    margin-left: 0 !important;
    overflow-wrap: anywhere;
  }

  .chat-list-panel {
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
  }
}

@media (max-width: 768px) {
  .chat-messages-panel {
    display: none;
    height: 500px;
    border-radius: 12px;
  }

  .chat-messages-panel.mobile-chat-open {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open {
    background: var(--bs-body-bg) !important;
  }

  .chat-messages-panel.mobile-chat-open .agent-widget-chat-view {
    border-radius: 0;
  }

  .chat-messages-panel.mobile-chat-open .agent-widget-header {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-right: calc(64px + env(safe-area-inset-right));
    padding-left: calc(16px + env(safe-area-inset-left));
  }

  #agentInfoChatWrapper.mobile-chat-open .agent-widget-header .chat-date {
    display: none;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .agent-widget-header .chat-info {
    display: none;
  }

  .chat-messages-panel.mobile-chat-open .chat-messages {
    max-height: none;
  }

  #agentInfoVoiceChatWrapper .voice-call-loading-shell {
    display: flex;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    background: var(--bs-body-bg);
  }

  #agentInfoVoiceChatWrapper .voice-call-loading-header {
    display: flex;
    min-height: 70px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: calc(12px + env(safe-area-inset-top)) 64px 12px 16px;
    background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 70%, #000));
    color: #fff;
  }

  #agentInfoVoiceChatWrapper .voice-call-loading-header strong {
    overflow: hidden;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #agentInfoVoiceChatWrapper .voice-call-loading-section {
    display: flex;
    min-height: 51px;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    color: var(--bs-body-color);
  }

  #agentInfoVoiceChatWrapper .voice-call-loading-section > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
  }

  #agentInfoVoiceChatWrapper .voice-call-loading-section strong {
    font-size: 0.8rem;
    line-height: 1.3;
  }

  #agentInfoVoiceChatWrapper .voice-call-loading-section small {
    overflow: hidden;
    color: var(--bs-secondary-color);
    font-size: 0.65rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #agentInfoVoiceChatWrapper .voice-call-loading-section > i {
    color: var(--bs-secondary-color);
    font-size: 0.7rem;
  }

  #agentInfoVoiceChatWrapper .voice-call-loading-section-icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
  }

  #agentInfoVoiceChatWrapper .voice-call-loading-transcript {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 16px;
    padding: 20px 16px;
    background: var(--bs-tertiary-bg);
  }

  #agentInfoVoiceChatWrapper .voice-call-load-error {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    text-align: center;
  }

  #agentInfoVoiceChatWrapper .voice-call-load-error i {
    color: var(--bs-danger);
    font-size: 1.6rem;
  }

  #agentInfoVoiceChatWrapper .voice-ghost-bubble {
    width: 74%;
    padding: 14px;
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 18px;
    background: var(--bs-body-bg);
  }

  #agentInfoVoiceChatWrapper .voice-ghost-bubble-right {
    align-self: flex-end;
    background: var(--bs-primary-bg-subtle);
  }

  #agentInfoVoiceChatWrapper .voice-ghost-line {
    width: 100%;
    height: 11px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), 0.08) 25%, rgba(var(--bs-primary-rgb), 0.2) 50%, rgba(var(--bs-primary-rgb), 0.08) 75%);
    background-size: 200% 100%;
    animation: voiceGhostShimmer 1.4s ease-in-out infinite;
  }

  #agentInfoVoiceChatWrapper .voice-ghost-line + .voice-ghost-line {
    margin-top: 9px;
  }

  #agentInfoVoiceChatWrapper .voice-ghost-on-primary {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 25%, rgba(255, 255, 255, 0.42) 50%, rgba(255, 255, 255, 0.18) 75%);
    background-size: 200% 100%;
  }

  #agentInfoVoiceChatWrapper .voice-ghost-line-medium {
    width: 72%;
  }

  #agentInfoVoiceChatWrapper .voice-ghost-line-short {
    width: 44%;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-call-context {
    display: block;
    flex: 0 0 auto;
    overflow: hidden;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color-translucent);
    position: relative;
    z-index: 2;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-details-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 0;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-align: left;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-details-icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-details-title {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-details-title strong {
    font-size: 0.8rem;
    line-height: 1.3;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-details-title small {
    overflow: hidden;
    color: var(--bs-secondary-color);
    font-size: 0.65rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-details-chevron {
    flex: 0 0 auto;
    color: var(--bs-secondary-color);
    font-size: 0.7rem;
    transition: transform 0.25s ease;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-call-context:not(.collapsed) .voice-mobile-details-chevron {
    transform: rotate(180deg);
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-details-content {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: min(58dvh, 480px);
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.2s ease;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-call-context.collapsed .voice-mobile-details-content {
    max-height: 0;
    opacity: 0;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 10px 14px;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-title,
  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-number {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-number > span { flex: 1 1 130px; }
  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-number .ps-contact-actions { margin-left: auto; }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-title strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-phone-link {
    width: fit-content;
    color: var(--bs-primary);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-phone-link:active {
    opacity: 0.72;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-date {
    grid-column: 1 / -1;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-item > i {
    width: 18px;
    flex: 0 0 18px;
    color: var(--bs-primary);
    text-align: center;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-item > span {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-item small {
    color: var(--bs-secondary-color);
    font-size: 0.65rem;
    line-height: 1.2;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-metadata-item strong {
    overflow: hidden;
    color: var(--bs-body-color);
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-audio {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 14px 10px;
    background: var(--bs-body-bg);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.06);
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-audio-unavailable {
    display: none;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-audio-label {
    color: var(--bs-secondary-color);
    font-size: 0.65rem;
    line-height: 1.2;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open #chatVoiceMobileAudio {
    width: 100%;
    min-width: 0;
    min-height: 40px;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .voice-mobile-load-error {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--bs-secondary-color);
    font-size: 0.72rem;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .chat-summary-header {
    padding: 10px 14px 8px;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .chat-summary-box {
    flex: 0 1 auto;
    max-height: 32dvh;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .chat-summary-content {
    padding-right: 14px;
    padding-left: 14px;
    max-height: calc(32dvh - 52px);
    overflow-y: auto;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .chat-summary-box.collapsed {
    max-height: 58px;
  }

  #agentInfoVoiceChatWrapper.mobile-chat-open .chat-summary-box.collapsed .chat-summary-content {
    max-height: 0;
    overflow: hidden;
  }

  #agentInfoVoiceChatWrapper .voice-call-loading {
    display: flex;
    flex: 1;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
  }

  @keyframes voiceGhostShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  .chat-messages-panel.mobile-chat-open .mobile-chat-close {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 1.1rem;
  }

  .chat-messages-panel.mobile-chat-open .mobile-chat-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }
}

@media (max-width: 768px) {
  .chat-list-item {
    padding: 10px 12px;
  }
}

@media (max-width: 768px) {
  .chat-list-item .channel-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 0.85rem;
  }
}
