.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 108px;
  z-index: 1200;
}

.chat-widget__circle {
  width: 72px;
  height: 72px;
  border: none;
  outline: none;
  border-radius: 50%;
  background: var(--clr-primary) !important;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(234, 127, 50, 0.22);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.chat-widget__circle:focus,
.chat-widget__circle:focus-visible,
.chat-widget__circle:active {
  outline: none;
  border: none;
}

.chat-widget__open-icon,
.chat-widget__close-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-widget__open-icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.chat-widget__close-icon {
  display: none;
  font-size: 34px;
  line-height: 1;
  font-weight: 300;
  color: #ffffff;
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 84px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: 72vh;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 28px;
  background: #ffffff;
  color: #18181b;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
  display: flex;
  flex-direction: column;
  z-index: 1300;
}

.chat-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
}

.chat-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-panel__header {
  background: #f97316;
  padding: 16px 20px;
  color: #ffffff;
}

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

.chat-panel__brand-image {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.chat-panel__brand-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.chat-panel__brand-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.92);
}

.chat-panel__status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74,222,128,0.8);
}

.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  background: #fafafa;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message--manager-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.chat-message__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
}

.chat-message__bubble {
  max-width: 240px;
  padding: 12px 16px;
  border-radius: 22px;
  font-size: 15px;
  line-height: 1.6;
}

.chat-message__bubble--manager {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

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

.chat-user-message {
  margin-left: auto;
  max-width: 240px;
  padding: 12px 16px;
  border-radius: 22px;
  background: #f97316;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.6;
}

.chat-user-photo {
  margin-left: auto;
  max-width: 240px;
  border-radius: 22px;
  background: #f97316;
  padding: 8px;
}

.chat-user-photo img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

.chat-error-message {
  max-width: 240px;
  padding: 12px 16px;
  border-radius: 22px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.6;
}

.emoji-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 88px;
  z-index: 30;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.emoji-tabs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f1f3;
}

.emoji-tab {
  min-width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

.emoji-tab.active {
  background: #fff7ed;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
}

.emoji-item {
  height: 42px;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.emoji-item:hover {
  background: rgba(249, 115, 22, 0.08);
}

.chat-panel__form {
  border-top: 1px solid #e4e4e7;
  background: #ffffff;
  padding: 12px;
}

.chat-panel__form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-panel__icon-btn,
.chat-panel__emoji-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #f4f4f5;
  color: #52525b;
  cursor: pointer;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.chat-panel__icon-btn:hover,
.chat-panel__emoji-btn:hover {
  transform: scale(1.05);
  background: #e4e4e7;
}

.chat-panel__emoji-btn {
  font-size: 22px;
}

.chat-panel__input {
  height: 52px;
  width: 100%;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  padding: 0 20px;
  font-size: 16px;
  color: #18181b;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-panel__input::placeholder {
  color: #a1a1aa;
}

.chat-panel__input:focus {
  border-color: #fb923c;
}

.chat-panel__submit {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: #f97316;
  color: #ffffff;
  cursor: pointer;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(249,115,22,0.28);
  transition: transform 0.2s ease, background 0.2s ease;
}

.chat-panel__submit:hover {
  transform: scale(1.05);
  background: #fb923c;
}

.chat-panel__file-name {
  padding: 8px 12px 0;
  font-size: 12px;
  color: #71717a;
}

.hidden {
  display: none !important;
}

.floating-up {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 72px;
  height: 72px;
  border: none;
  outline: none;
  border-radius: 50%;
  background: #111217;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  z-index: 1190;
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background 0.25s ease;
}

.floating-up:hover {
  transform: scale(1.06);
  background: #27272a;
}

.floating-up svg {
  width: 26px;
  height: 26px;
  display: block;
  color: #ffffff;
}
.chat-message__meta,
.chat-user-message__meta,
.chat-user-photo__meta {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.3;
  color: #a1a1aa;
}

.chat-user-message-wrap,
.chat-user-photo-wrap {
  margin-left: auto;
  max-width: 240px;
}

.chat-user-message {
  margin-left: 0;
}

.chat-user-photo {
  margin-left: 0;
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 44px;
}

.chat-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4d4d8;
  animation: chatTypingBounce 1s infinite ease-in-out;
}

.chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatTypingBounce {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.6;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chat-widget__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #ffffff;
  display: none;
  pointer-events: none;
}

.chat-widget__badge.is-visible {
  display: block;
}