.support-chat-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  font-family: "Manrope", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.support-chat-widget[hidden] {
  display: none !important;
}

.support-chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(14,165,233,.94), rgba(16,185,129,.92));
  box-shadow: 0 24px 64px rgba(8, 47, 73, 0.36);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.support-chat-toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f8fafc;
  box-shadow: 0 0 0 8px rgba(255,255,255,.16);
}

.support-chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(420px, calc(100vw - 24px));
  height: min(78dvh, 760px);
  max-height: calc(100dvh - 96px);
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  background:
    linear-gradient(180deg, rgba(8, 15, 35, 0.97), rgba(5, 10, 24, 0.98)),
    radial-gradient(circle at top, rgba(56, 189, 248, 0.18), transparent 42%);
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(.98);
  transition: opacity .22s ease, transform .22s ease;
}

.support-chat-widget.is-open .support-chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.support-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.14);
}

.support-chat-kicker {
  margin-bottom: 6px;
  color: rgba(125, 211, 252, 0.92);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.support-chat-title {
  margin: 0;
  color: #f8fafc;
  font-size: 21px;
  line-height: 1.1;
}

.support-chat-status {
  margin: 8px 0 0;
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
  line-height: 1.45;
}

.support-chat-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.62);
  color: #cbd5e1;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.support-chat-meta {
  flex: 0 0 auto;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.12);
  background: rgba(8, 15, 35, 0.56);
}

.support-chat-body {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.support-chat-meta-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.support-chat-meta-copy {
  margin: 0;
  color: rgba(226, 232, 240, 0.82);
  font-size: 13px;
  line-height: 1.45;
}

.support-chat-meta-hint {
  color: rgba(125, 211, 252, 0.84);
  font-size: 12px;
  line-height: 1.4;
}

.support-chat-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.support-chat-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.support-chat-field-wide {
  grid-column: 1 / -1;
}

.support-chat-field span {
  color: rgba(203, 213, 225, 0.82);
  font-size: 12px;
  font-weight: 700;
}

.support-chat-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  padding: 12px 13px;
  font: inherit;
}

.support-chat-field input::placeholder,
.support-chat-input::placeholder {
  color: rgba(148, 163, 184, 0.78);
}

.support-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-chat-empty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.54);
  color: rgba(226, 232, 240, 0.85);
  font-size: 14px;
  line-height: 1.5;
}

.support-chat-bubble {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 14px;
  word-break: break-word;
}

.support-chat-bubble.is-client {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.94), rgba(16, 185, 129, 0.92));
  color: #ecfeff;
}

.support-chat-bubble.is-operator {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  border: 1px solid rgba(125, 211, 252, 0.18);
}

.support-chat-bubble.is-system {
  align-self: center;
  max-width: 94%;
  background: rgba(51, 65, 85, 0.58);
  color: rgba(226, 232, 240, 0.86);
  text-align: center;
}

.support-chat-bubble-meta {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: rgba(226, 232, 240, 0.68);
  font-size: 11px;
}

.support-chat-attachments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.support-chat-attachment-photo {
  display: block;
  width: min(100%, 260px);
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
  user-select: none;
}

.support-chat-attachment-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
}

.support-chat-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
}

.support-chat-attachment-list {
  grid-column: 1 / -1;
  grid-row: 1;
  padding: 0 0 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.support-chat-attachment-list[hidden] {
  display: none !important;
}

.support-chat-attachment-chip {
  display: inline-grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(100%, 320px);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: rgba(18, 22, 34, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.support-chat-attachment-chip.is-loading {
  opacity: 0.96;
}

.support-chat-attachment-chip-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(39, 45, 60, 0.96);
  color: rgba(226, 232, 240, 0.9);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.support-chat-attachment-chip-thumb.is-image {
  color: transparent;
}

.support-chat-attachment-chip-thumb.is-loading {
  background: rgba(255, 255, 255, 0.08);
  color: transparent;
}

.support-chat-attachment-chip-loader {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: block;
  background: conic-gradient(from -90deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.14));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: support-chat-attachment-loader-spin 0.95s linear infinite;
}

.support-chat-attachment-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-chat-attachment-chip-remove {
  border: 0;
  background: transparent;
  color: rgba(226, 232, 240, 0.82);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  width: 20px;
  height: 20px;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.support-chat-attachment-chip-remove[disabled] {
  opacity: 0;
  pointer-events: none;
}

.support-chat-form {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: end;
  gap: 12px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(125, 211, 252, 0.14);
  background: rgba(2, 6, 23, 0.96);
  box-shadow: 0 -18px 40px rgba(2, 6, 23, 0.26);
}

.support-chat-input {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  min-height: 52px;
  resize: none;
  overflow-y: hidden;
  border: 0;
  border-radius: 26px;
  background: rgba(49, 54, 61, 0.96);
  color: #f8fafc;
  padding: 14px 18px;
  font: inherit;
  font-size: 17px;
  line-height: 1.35;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.support-chat-actions {
  display: contents;
}

.support-chat-actions-left {
  display: contents;
}

.support-chat-secondary-btn,
.support-chat-send-btn {
  border: 0;
  border-radius: 999px;
  width: 52px;
  height: 52px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0;
  line-height: 1;
  position: relative;
}

.support-chat-secondary-btn {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  background: rgba(49, 54, 61, 0.96);
  color: rgba(211, 218, 230, 0.92);
}

.support-chat-send-btn {
  grid-column: 3;
  grid-row: 2;
  align-self: end;
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(61, 210, 214, 0.98), rgba(32, 194, 167, 0.96));
  box-shadow: 0 10px 28px rgba(27, 171, 176, 0.34);
}

.support-chat-secondary-btn::before,
.support-chat-send-btn::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.support-chat-secondary-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9.5 12.5 15.9 6.1a3.6 3.6 0 1 1 5.1 5.1l-9 9a5.2 5.2 0 0 1-7.4-7.4l8.6-8.6' stroke='%23cfd6e4' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.support-chat-send-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M3.7 20.3 21 12 3.7 3.7l3 6.6L14 12l-7.3 1.7-3 6.6Z' fill='%23ffffff'/%3E%3C/svg%3E");
}

.support-chat-send-btn[disabled],
.support-chat-secondary-btn[disabled] {
  opacity: .56;
  cursor: not-allowed;
}

.support-chat-input:focus-visible,
.support-chat-send-btn:focus-visible,
.support-chat-secondary-btn:focus-visible {
  outline: 0;
  box-shadow: none;
}

.support-chat-input:focus-visible {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.support-chat-close:focus-visible,
.support-chat-toggle:focus-visible,
.support-chat-attachment-chip-remove:focus-visible {
  outline: 0;
  box-shadow: none;
}

.support-chat-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

@keyframes support-chat-attachment-loader-spin {
  to {
    transform: rotate(1turn);
  }
}

@media (max-width: 640px) {
  .support-chat-widget {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .support-chat-toggle {
    width: 100%;
    justify-content: center;
  }

  .support-chat-panel {
    right: 0;
    left: 0;
    bottom: 68px;
    width: 100%;
    height: min(calc(100dvh - 92px), 680px);
    max-height: calc(100dvh - 92px);
  }

  .support-chat-header {
    padding: 16px 16px 10px;
  }

  .support-chat-meta {
    padding: 12px 16px;
  }

  .support-chat-meta-head {
    gap: 6px;
  }

  .support-chat-meta-grid {
    grid-template-columns: 1fr;
  }

  .support-chat-messages {
    padding: 12px 16px;
  }

  .support-chat-attachment-photo {
    width: min(100%, 220px);
  }

  .support-chat-attachment-list {
    padding: 0 0 8px;
  }

  .support-chat-form {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 10px;
    padding: 12px 16px 16px;
  }

  .support-chat-input {
    min-height: 48px;
    padding: 13px 16px;
    font-size: 16px;
  }

  .support-chat-send-btn,
  .support-chat-secondary-btn {
    width: 48px;
    height: 48px;
    justify-content: center;
  }

  .support-chat-bubble {
    max-width: 100%;
  }
}

@media (max-height: 820px) {
  .support-chat-panel {
    height: calc(100dvh - 88px);
    max-height: calc(100dvh - 88px);
  }

  .support-chat-header {
    padding: 16px 16px 10px;
  }

  .support-chat-meta {
    padding: 12px 16px;
  }

  .support-chat-messages {
    padding: 12px 16px;
  }

  .support-chat-form {
    padding: 12px 16px 16px;
  }

  .support-chat-input {
    min-height: 46px;
  }
}
