.dgcrm-site-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10010;
  font-family: Inter, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}
.dgcrm-site-chat[hidden] {
  display: none !important;
}
.dgcrm-site-chat-toggle {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: min(250px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(14, 19, 26, 0.96) 0%, rgba(33, 47, 62, 0.96) 100%);
  color: #fff;
  box-shadow:
    0 20px 44px rgba(9, 14, 20, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(12px);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease,
    opacity 0.18s ease;
}
.dgcrm-site-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 54px rgba(9, 14, 20, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.dgcrm-site-chat-toggle:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 3px rgba(129, 209, 0, 0.24),
    0 24px 54px rgba(9, 14, 20, 0.38);
}
.dgcrm-site-chat-toggle__eyebrow {
  display: block;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
}
.dgcrm-site-chat-toggle__cta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, #81d100 0%, #64b700 38%, #0f678b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 12px 26px rgba(50, 115, 17, 0.26);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
}
.dgcrm-site-chat-toggle:hover .dgcrm-site-chat-toggle__cta {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 16px 30px rgba(50, 115, 17, 0.3);
  filter: brightness(1.02);
}
.dgcrm-site-chat-toggle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.dgcrm-site-chat-toggle__icon svg {
  display: block;
  width: 22px;
  height: 22px;
}
.dgcrm-site-chat-toggle__text {
  font-size: 17px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #fff;
}
.dgcrm-site-chat-window {
  display: flex;
  flex-direction: column;
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(392px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 20px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(0.96);
  transform-origin: right bottom;
  transition:
    opacity 0.22s ease,
    transform 0.24s ease,
    visibility 0s linear 0.24s;
}
.dgcrm-site-chat.is-open .dgcrm-site-chat-window {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.22s ease,
    transform 0.24s ease,
    visibility 0s linear 0s;
}
.dgcrm-site-chat.is-open .dgcrm-site-chat-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.97);
}
.dgcrm-site-chat-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 16px 14px;
  background: linear-gradient(135deg, #101418, #24303c);
  color: #fff;
}
.dgcrm-site-chat-title {
  font-size: 18px;
  font-weight: 700;
}
.dgcrm-site-chat-sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.78);
}
.dgcrm-site-chat-close {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.dgcrm-site-chat-messages {
  max-height: 320px;
  overflow: auto;
  padding: 14px;
  background: #f5f8fb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dgcrm-site-chat-message {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}
.dgcrm-site-chat-message.is-visitor {
  align-self: flex-end;
  background: #101418;
  color: #fff;
  border-top-right-radius: 4px;
}
.dgcrm-site-chat-message.is-manager {
  align-self: flex-start;
  background: #fff;
  color: #111;
  border: 1px solid #e6ebf2;
  border-top-left-radius: 4px;
}
.dgcrm-site-chat-message.is-system {
  align-self: center;
  max-width: 92%;
  background: #e8eef5;
  color: #324050;
  border: 1px solid #d2dbe6;
  box-shadow: none;
}
.dgcrm-site-chat-message.is-gift {
  padding: 10px;
}
.dgcrm-site-chat-gift {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.dgcrm-site-chat-gift img {
  display: block;
  width: 100%;
  max-width: 190px;
  height: auto;
  border-radius: 12px;
}
.dgcrm-site-chat-gift__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: #1f2532;
}
.dgcrm-site-chat-gift__text {
  font-size: 12px;
  line-height: 1.4;
  color: #5f6773;
}
.dgcrm-site-chat-message.is-typing {
  opacity: 0.8;
  font-style: italic;
}
.dgcrm-site-chat-typing__body {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dgcrm-site-chat-typing__dots {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  min-width: 22px;
}
.dgcrm-site-chat-typing__dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: dgcrm-chat-typing-bounce 1.2s infinite ease-in-out;
}
.dgcrm-site-chat-typing__dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.dgcrm-site-chat-typing__dots span:nth-child(3) {
  animation-delay: 0.3s;
}
.dgcrm-site-chat-message__meta {
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.72;
}
.dgcrm-site-chat-identify {
  padding: 0 14px 10px;
  background: #fff;
}
.dgcrm-site-chat-identify details {
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  padding: 10px 12px;
}
.dgcrm-site-chat-identify summary {
  cursor: pointer;
  font-weight: 600;
  color: #3c4655;
}
.dgcrm-site-chat-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}
.dgcrm-site-chat-note {
  font-size: 13px;
  line-height: 1.35;
  color: #5f6773;
}
.dgcrm-site-chat-contact-tabs {
  display: grid;
  gap: 8px;
}
.dgcrm-site-chat-contact-tabs__row {
  display: grid;
  gap: 8px;
}
.dgcrm-site-chat-contact-tabs__row:first-child {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dgcrm-site-chat-contact-tabs__row:last-child {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dgcrm-site-chat-contact-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d7dfeb;
  background: #fff;
  color: #39414d;
  border-radius: 999px;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.dgcrm-site-chat-contact-tab span {
  white-space: nowrap;
}
.dgcrm-site-chat-contact-tab img {
  width: 20px;
  height: 20px;
  display: block;
}
.dgcrm-site-chat-contact-tab .fa {
  font-size: 18px;
}
.dgcrm-site-chat-contact-tab--icon-only {
  padding: 8px;
}
.dgcrm-site-chat-contact-tab.is-active {
  background: linear-gradient(135deg, #81d100, #5ca800);
  border-color: #6eb200;
  color: #fff;
  box-shadow: 0 10px 24px rgba(92, 168, 0, 0.2);
}
.dgcrm-site-chat-contact-tab.is-active img {
  filter: brightness(0) invert(1);
}
.dgcrm-site-chat-input,
.dgcrm-site-chat-textarea {
  width: 100%;
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  box-sizing: border-box;
}
.dgcrm-site-chat-textarea {
  min-height: 88px;
  resize: vertical;
}
.dgcrm-site-chat-save {
  border: none;
  border-radius: 12px;
  background: #81d100;
  color: #fff;
  padding: 11px 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(92, 168, 0, 0.18);
}
.dgcrm-site-chat-save[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.dgcrm-site-chat-compose {
  padding: 0 14px 14px;
  background: #fff;
}
.dgcrm-site-chat-policy {
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid #e5ebf3;
  border-radius: 12px;
  background: #fafcff;
}
.dgcrm-site-chat-policy__note {
  font-size: 10px;
  line-height: 1.45;
  color: #8893a3;
}
.dgcrm-site-chat-policy__note a {
  color: #6f94d6;
  text-decoration: none;
}
.dgcrm-site-chat-policy__note a:hover {
  text-decoration: underline;
}
.dgcrm-site-chat-policy__check {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.45;
  color: #8893a3;
  cursor: pointer;
}
.dgcrm-site-chat-policy__check input {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  margin: 0;
}
.dgcrm-site-chat-policy__check span {
  display: inline;
}
.dgcrm-site-chat-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.dgcrm-site-chat-status {
  font-size: 12px;
  line-height: 1.3;
  color: #5c6675;
}
.dgcrm-site-chat-send {
  border: none;
  border-radius: 12px;
  background: #24303c;
  color: #fff;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.dgcrm-site-chat-send[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}
@keyframes dgcrm-chat-typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  40% {
    transform: translateY(-3px);
    opacity: 0.85;
  }
}
@media (max-width: 640px) {
  .dgcrm-site-chat {
    right: 10px;
    left: 10px;
    bottom: 10px;
    align-items: stretch;
  }
  .dgcrm-site-chat-toggle {
    align-self: flex-end;
    width: min(100%, 250px);
    padding: 10px;
    border-radius: 20px;
  }
  .dgcrm-site-chat-toggle__eyebrow {
    font-size: 12px;
  }
  .dgcrm-site-chat-toggle__cta {
    min-height: 54px;
    padding: 10px 12px;
    border-radius: 16px;
  }
  .dgcrm-site-chat-toggle__icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
  }
  .dgcrm-site-chat-toggle__text {
    font-size: 16px;
  }
  .dgcrm-site-chat-window {
    left: auto;
    right: 0;
    bottom: 0;
    width: min(100%, 380px);
  }
}
