.chat-widget {
  position: fixed;
  right: 80px;
  bottom: 120px;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #0f1417;
  color: #f5f7fa;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 1001;
  display: none;
}

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

.chat-header {
  background: linear-gradient(135deg, #00b8ae, #11c7bd);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 18px rgba(0, 184, 174, 0.35);
}

.chat-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f1417;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: hidden;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-header-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
}

.chat-header-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.chat-header-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3cffc3;
  box-shadow: 0 0 0 3px rgba(60, 255, 195, 0.2);
}

.chat-header-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 0;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.chat-body {
  background: #f4f7fb;
  padding: 16px;
  height: auto;
  min-height: 0;
  max-height: 320px;
  overflow-y: auto;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.chat-bubble img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.chat-bubble a {
  color: inherit;
  text-decoration: underline;
}

.chat-bubble.visitor {
  background: #00b6a8;
  color: #fff;
  margin-left: auto;
}

.chat-bubble.manager {
  background: #fff;
  color: #1c2430;
  border: 1px solid #e3e8ef;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e6edf5;
}

.chat-input button[data-chat-attach] {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eef3f8;
  color: #4a5a6a;
  border: 0;
  cursor: pointer;
}

.chat-input input {
  flex: 1;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.chat-input button {
  background: #00b6a8;
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat-status {
  font-size: 12px;
  color: #e7fffd;
  margin-top: 4px;
}

.chat-contact {
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}

.chat-contact.is-collapsed {
  display: none;
}

.chat-contact-title {
  font-size: 14px;
  color: #1c2430;
  margin-bottom: 8px;
}

.chat-contact input {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  font-size: 13px;
}

.chat-contact input.is-hidden {
  display: none;
}

.chat-contact-actions {
  display: flex;
  gap: 10px;
}

.chat-contact-actions button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.chat-contact-actions button[data-chat-save-contact] {
  background: #00b8ae;
  color: #fff;
  border: 0;
}

.chat-contact-actions button[data-chat-skip-contact] {
  background: #f5f7fa;
  color: #7a8794;
  border: 1px solid #d7e0ea;
}

@media (max-width: 700px) {
  .chat-body {
    max-height: 45vh;
  }
}

@media (max-width: 700px) {
  .chat-widget {
    right: 16px;
    bottom: 140px;
  }
}
