.dchat {
  display: flex;
  height: calc(100vh - 180px);
  min-height: 480px;
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 12px;
  overflow: hidden;
  font-size: 15px;
}

.dchat__inbox {
  width: 340px;
  flex-shrink: 0;
  border-right: 1px solid #e6e8eb;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dchat__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 18px 20px;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1px solid #e6e8eb;
}

.dchat__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #80c10d;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.dchat__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.dchat__item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  color: inherit;
  border-bottom: 1px solid #f0f1f3;
  text-decoration: none !important;
}

.dchat__item:hover {
  background: #f5f7f9;
  color: inherit;
}

.dchat__item.is-active {
  background: #eef6e0;
}

.dchat__item.is-unread .dchat__item-name,
.dchat__item.is-unread .dchat__item-preview {
  font-weight: 600;
  color: #222;
}

.dchat__thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f7f9;
}

.dchat__thumb img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}

.dchat__thumb-ph {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: #8a9099;
  font-size: 20px;
  font-weight: 600;
}

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

.dchat__item-top,
.dchat__item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dchat__item-name,
.dchat__item-listing,
.dchat__item-preview {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dchat__item-name {
  font-weight: 500;
  color: #333;
}

.dchat__item-time {
  flex-shrink: 0;
  font-size: 12px;
  color: #8a9099;
}

.dchat__item-listing {
  font-size: 13px;
  color: #6aa308;
}

.dchat__item-preview {
  font-size: 13px;
  color: #8a9099;
}

.dchat__thread {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f5f7f9;
}

.dchat__thread.is-dragging::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed #80c10d;
  border-radius: 12px;
  background: rgba(128, 193, 13, 0.08);
  pointer-events: none;
}

.dchat__placeholder,
.dchat__empty,
.dchat__loading {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: #8a9099;
  text-align: center;
}

.dchat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid #e6e8eb;
}

.dchat__head-user {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dchat__head-user strong {
  font-size: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dchat__head-user small {
  color: #8a9099;
  font-size: 12px;
}

.dchat__back {
  display: none;
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px 4px 0;
  cursor: pointer;
}

.dchat__listing {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: #fff;
  border-bottom: 1px solid #e6e8eb;
  color: inherit;
  text-decoration: none !important;
}

.dchat__listing:hover {
  color: inherit;
}

.dchat__listing img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  -o-object-fit: cover;
     object-fit: cover;
}

.dchat__listing > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dchat__listing-title {
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dchat__listing-price {
  font-weight: 600;
  color: #6aa308;
  font-size: 14px;
}

.dchat__listing-off {
  font-size: 13px;
  color: #8a9099;
}

.dchat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dchat__more {
  text-align: center;
  margin-bottom: 8px;
}

.dchat__link {
  border: 0;
  background: none;
  color: #6aa308;
  font-size: 13px;
  cursor: pointer;
}

.dchat__day {
  text-align: center;
  margin: 12px 0 6px;
}

.dchat__day span {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  color: #666;
  font-size: 12px;
}

.dchat__msg {
  display: flex;
}

.dchat__msg.is-mine {
  justify-content: flex-end;
}

.dchat__msg.is-mine .dchat__bubble {
  background: #e9f6d3;
  border-bottom-right-radius: 4px;
}

.dchat__msg.is-theirs .dchat__bubble {
  background: #fff;
  border-bottom-left-radius: 4px;
}

.dchat__bubble {
  max-width: min(75%, 520px);
  padding: 8px 12px 6px;
  border-radius: 14px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.dchat__text {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.dchat__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  color: #8a9099;
}

.dchat__ticks {
  letter-spacing: -3px;
  padding-right: 3px;
}

.dchat__ticks.is-read {
  color: #34b7f1;
}

.dchat__files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.dchat__img img {
  display: block;
  max-width: 260px;
  max-height: 260px;
  border-radius: 10px;
  -o-object-fit: cover;
     object-fit: cover;
}

.dchat__file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  color: inherit;
  text-decoration: none !important;
  max-width: 280px;
}

.dchat__file-icon {
  flex-shrink: 0;
  padding: 6px;
  border-radius: 6px;
  background: #e5533d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.dchat__file-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dchat__file-name small {
  color: #8a9099;
}

.dchat__composer {
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid #e6e8eb;
}

.dchat__row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.dchat textarea {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 140px;
  padding: 10px 14px;
  border: 1px solid #e6e8eb;
  border-radius: 21px;
  outline: none;
  font-size: 15px;
  line-height: 1.35;
}

.dchat textarea:focus {
  border-color: #80c10d;
}

.dchat__send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: #80c10d;
  color: #fff;
  cursor: pointer;
}

.dchat__send:hover {
  background: #6aa308;
}

.dchat__send:disabled {
  background: #cfd5db;
  cursor: default;
}

.dchat__chosen {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.dchat__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  border-radius: 12px;
  background: #f5f7f9;
  font-size: 12px;
}

.dchat__chip button {
  border: 0;
  background: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #8a9099;
}

.dchat__error {
  margin-bottom: 8px;
  color: #d9534f;
  font-size: 13px;
}

.dchat__btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 6px;
  background: #80c10d;
  color: #fff !important;
  text-decoration: none !important;
}

.dchat__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e6e8eb;
  border-top-color: #80c10d;
  border-radius: 50%;
  animation: dchat-spin 0.8s linear infinite;
}

@media (max-width: 767px) {
  .dchat {
    height: calc(100vh - 120px);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .dchat__inbox {
    width: 100%;
    border-right: 0;
  }

  .dchat__thread {
    display: none;
  }

  .dchat--open .dchat__inbox {
    display: none;
  }

  .dchat--open .dchat__thread {
    display: flex;
  }

  .dchat__back {
    display: block;
  }

  .dchat__bubble {
    max-width: 85%;
  }

  .dchat__img img {
    max-width: 200px;
  }
}

@keyframes dchat-spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-unread-badge {
  display: inline-block;
  min-width: 20px;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #80c10d;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.chat-contact__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 15px;
  padding: 12px 16px;
  border: 0;
  border-radius: 6px;
  background: #80c10d;
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
}

.chat-contact__btn:hover {
  background: #6aa308;
}

.chat-contact__form {
  display: none;
  margin-bottom: 15px;
}

.chat-contact__form.is-open {
  display: block;
}

.chat-contact__form textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid #e6e8eb;
  border-radius: 8px;
  resize: vertical;
  font-size: 15px;
}

.chat-contact__form textarea:focus {
  outline: none;
  border-color: #80c10d;
}

.chat-contact__error {
  display: none;
  margin: 6px 0;
  color: #d9534f;
  font-size: 13px;
}

