.desktop-message-thread-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
  background: var(--theme-panel, #ffffff);
}

.desktop-thread-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--theme-border, #e2e8f0);
  border-left: 3px solid transparent;
  background: var(--theme-panel, #ffffff);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.desktop-thread-item:hover {
  background: var(--theme-panel, #f1f5f9);
}

.desktop-thread-item.is-selected {
  background: var(--theme-panel, #eaf2fc) !important;
  border-left-color: #f0523d;
}

.desktop-thread-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--theme-text, #21133d) 0%, #4c2882 100%);
  color: var(--mobile-brand-text, #ffffff);
  font-size: 12px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--theme-text, #21133d) 15%, transparent);
}

.desktop-thread-avatar-large {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.desktop-thread-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.desktop-thread-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.desktop-thread-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--theme-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-thread-time {
  font-size: 11px;
  color: var(--theme-quiet, #64748b);
  flex-shrink: 0;
}

.desktop-thread-phone {
  font-size: 11px;
  color: var(--theme-quiet, #64748b);
  line-height: 1.2;
}

.desktop-thread-bottom-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.desktop-thread-snippet {
  font-size: 12px;
  color: var(--theme-quiet, #475569);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.desktop-messages-empty-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--theme-quiet, #64748b);
}

.desktop-messages-empty-list .empty-list-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.desktop-messages-empty-list .empty-list-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--theme-text, #1e293b);
  margin: 0 0 4px;
}

.desktop-messages-empty-list .empty-list-sub {
  font-size: 12px;
  margin: 0;
}

.desktop-messages-detail-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--theme-panel, #ffffff);
}

.desktop-message-workspace {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--theme-panel, #ffffff);
}

.desktop-messages-empty-workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 20px;
  text-align: center;
  color: var(--theme-quiet, #64748b);
}

.desktop-messages-empty-workspace .empty-workspace-graphic {
  color: var(--theme-quiet, #94a3b8);
  margin-bottom: 12px;
}

.desktop-messages-empty-workspace h3 {
  font-size: 16px;
  font-weight: 750;
  color: var(--theme-text, #1e293b);
  margin: 0 0 8px;
}

.desktop-messages-empty-workspace p {
  font-size: 13px;
  color: var(--theme-quiet, #64748b);
  max-width: 360px;
  margin: 0 0 16px;
  line-height: 1.5;
}

.desktop-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--theme-border, #e2e8f0);
  background: var(--theme-panel, #f8fafc);
  flex-shrink: 0;
}

.desktop-thread-header-contact {
  display: flex;
  align-items: center;
  gap: 12px;
}

.desktop-thread-header-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.desktop-thread-contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  margin-left: -6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--theme-text, #0f172a);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.desktop-thread-contact-pill:hover {
  background: rgba(240, 82, 61, 0.08);
  color: #f0523d;
}

.desktop-thread-contact-pill .contact-chevron {
  color: var(--theme-quiet, #94a3b8);
  font-size: 15px;
  font-weight: 800;
}

.desktop-thread-submeta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.desktop-thread-link {
  font-size: 12px;
  color: var(--theme-quiet, #475569);
  text-decoration: none;
  transition: color 0.15s ease;
}

.desktop-thread-link:hover {
  color: #f0523d;
  text-decoration: underline;
}

.desktop-thread-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--message-zoom, 1));
  background: var(--theme-panel, #f8fafc);
  min-height: 0;
}

.desktop-chat-date-divider {
  align-self: center;
  font-size: calc(11px * var(--message-zoom, 1));
  font-weight: 600;
  color: var(--theme-quiet, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(33, 19, 61, 0.05);
  padding: 3px 12px;
  border-radius: 999px;
  margin: 8px 0 4px;
}

.desktop-chat-welcome {
  align-self: center;
  text-align: center;
  max-width: 400px;
  margin: 40px auto;
  padding: 24px;
  background: var(--theme-panel, #ffffff);
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 12px;
}

.desktop-chat-welcome .welcome-badge {
  font-size: 28px;
  margin-bottom: 8px;
}

.desktop-chat-welcome h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--theme-text, #1e293b);
}

.desktop-chat-welcome p {
  margin: 0;
  font-size: 12px;
  color: var(--theme-quiet, #64748b);
  line-height: 1.45;
}

.desktop-chat-msg-row {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.desktop-chat-msg-row.is-outgoing {
  align-items: flex-end;
}

.desktop-chat-msg-row.is-incoming {
  align-items: flex-start;
}

.desktop-chat-bubble {
  max-width: 72%;
  padding: calc(9px * var(--message-zoom, 1)) calc(14px * var(--message-zoom, 1));
  font-size: calc(13px * var(--message-zoom, 1));
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.desktop-chat-msg-row.is-outgoing .desktop-chat-bubble {
  background: linear-gradient(135deg, var(--theme-accent, #ec665c) 0%, #e05349 100%);
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--theme-accent, #ec665c) 22%, transparent);
}

.desktop-chat-msg-row.is-incoming .desktop-chat-bubble {
  background: var(--theme-panel, #f1f5f9);
  border: 1px solid var(--theme-border, #e2e8f0);
  color: var(--theme-text, #0f172a);
  border-radius: 18px 18px 18px 4px;
}

.desktop-chat-subtext {
  font-size: calc(11px * var(--message-zoom, 1));
  color: #8e8e93;
  margin-top: 3px;
  padding: 0 4px;
}

.desktop-chat-msg-row.is-outgoing .desktop-chat-subtext {
  text-align: right;
}

.desktop-chat-msg-row.is-incoming .desktop-chat-subtext {
  text-align: left;
}

.desktop-chat-bubble-card {
  max-width: min(480px, 85%);
  display: flex;
  flex-direction: column;
  gap: calc(6px * var(--message-zoom, 1));
  padding: calc(10px * var(--message-zoom, 1)) calc(13px * var(--message-zoom, 1));
  border-radius: 18px 18px 4px 18px;
  background: var(--theme-panel, #ffffff);
  border: 1px solid var(--theme-border, #cbd5e1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 2px;
  transition: all 0.15s ease;
}

.desktop-chat-bubble-card:hover {
  border-color: var(--theme-border, #94a3b8);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.desktop-chat-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.desktop-chat-bubble-time {
  font-size: calc(11px * var(--message-zoom, 1));
  color: var(--theme-quiet, #475569);
  font-weight: 600;
}

.desktop-chat-status-badge {
  font-size: calc(10px * var(--message-zoom, 1));
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--theme-panel, #f1f5f9);
  color: var(--theme-quiet, #475569);
}

.desktop-chat-status-badge.is-confirmed {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.desktop-chat-status-badge.is-completed {
  background: var(--theme-panel, #eff6ff);
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.desktop-chat-status-badge.is-cancelled {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.desktop-chat-status-badge.is-requested,
.desktop-chat-status-badge.is-pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.desktop-chat-service-info {
  font-size: calc(12px * var(--message-zoom, 1));
  color: var(--theme-quiet, #334155);
  background: var(--theme-panel, #f8fafc);
  padding: calc(6px * var(--message-zoom, 1)) calc(9px * var(--message-zoom, 1));
  border-radius: 8px;
  border: 1px solid var(--theme-border, #edf2f7);
  line-height: 1.35;
}

.desktop-chat-service-info strong {
  color: var(--theme-text, #0f172a);
}

.desktop-chat-action-btn {
  align-self: flex-start;
  padding: calc(4px * var(--message-zoom, 1)) calc(12px * var(--message-zoom, 1));
  border: 0;
  border-radius: 999px;
  background: var(--theme-accent, #ec665c);
  color: #ffffff;
  font-size: calc(11px * var(--message-zoom, 1));
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--theme-accent, #ec665c) 25%, transparent);
  transition: all 0.15s ease;
}

.desktop-chat-action-btn:hover {
  background: #e05349;
  transform: translateY(-1px);
}

.desktop-chat-action-btn:active {
  transform: scale(0.96);
}

.desktop-chat-appointment-card {
  max-width: 75%;
  border-radius: 12px;
  background: var(--theme-panel, #ffffff);
  border: 1px solid var(--theme-border, #cbd5e1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 4px;
}

.desktop-chat-appointment-card .appt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--theme-panel, #f1f5f9);
  border-bottom: 1px solid var(--theme-border, #e2e8f0);
}

.desktop-chat-appointment-card .appt-card-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.desktop-chat-appointment-card .appt-card-service {
  font-size: 13px;
  font-weight: 700;
  color: var(--theme-text, #0f172a);
}

.desktop-chat-appointment-card .appt-card-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
}

.desktop-chat-appointment-card .appt-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.desktop-chat-appointment-card .appt-card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--theme-quiet, #475569);
}

.desktop-chat-appointment-card .appt-card-action-btn {
  border: 0;
  background: transparent;
  color: #f0523d;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease;
}

.desktop-chat-appointment-card .appt-card-action-btn:hover {
  text-decoration: underline;
}

.desktop-chat-templates-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 16px 4px;
  background: var(--theme-panel, #ffffff);
  border-top: 1px solid var(--theme-border, #e2e8f0);
  flex-shrink: 0;
}

.desktop-template-chip {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--theme-panel, #f1f5f9);
  border: 1px solid var(--theme-border, #cbd5e1);
  color: var(--theme-quiet, #334155);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.desktop-template-chip:hover {
  background: var(--theme-panel, #e2e8f0);
  color: var(--theme-text, #0f172a);
}

.desktop-chat-composer-wrapper {
  background: var(--theme-panel, #ffffff);
  padding: 4px 16px 10px;
  flex-shrink: 0;
}

.desktop-chat-composer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 14px;
  background: var(--theme-panel, #f1f5f9);
  border: 1px solid var(--theme-border, #cbd5e1);
  border-radius: 24px;
  transition: all 0.15s ease;
}

.desktop-chat-composer-bar:focus-within {
  background: var(--theme-panel, #ffffff);
  border-color: #f0523d;
  box-shadow: 0 0 0 2px rgba(240, 82, 61, 0.15);
}

.desktop-chat-textarea {
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
  resize: none;
  font-size: 13px;
  line-height: 1.4;
  max-height: 120px;
  font-family: inherit;
  color: var(--theme-text, #0f172a);
  padding: 4px 0;
}

.desktop-chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: #f0523d;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.desktop-chat-send-btn:hover:not(:disabled) {
  background: #d83d29;
  transform: scale(1.05);
}

.desktop-chat-send-btn.is-disabled,
.desktop-chat-send-btn:disabled {
  background: #cbd5e1;
  color: var(--theme-quiet, #94a3b8);
  cursor: not-allowed;
  transform: none;
}

.desktop-chat-textarea:disabled {
  color: var(--theme-quiet, #94a3b8);
  cursor: not-allowed;
}

.desktop-chat-disclaimer {
  font-size: 11px;
  color: var(--theme-quiet, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.disclaimer-link-btn {
  border: 0;
  background: transparent;
  color: #f0523d;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.disclaimer-link-btn:hover {
  text-decoration: underline;
}

