.ai-support-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  color: #29231d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ai-support-widget,
.ai-support-widget * {
  box-sizing: border-box;
}

.ai-support-widget__launcher,
.ai-support-widget__form button,
.ai-support-widget__close {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.ai-support-widget__launcher {
  display: grid;
  grid-template-columns: 24px auto;
  align-items: center;
  gap: 8px;
  min-width: 96px;
  height: 58px;
  padding: 0 17px 0 13px;
  border: 2px solid #29231d;
  border-radius: 999px;
  color: #29231d;
  background: #ffb431;
  box-shadow: 0 4px 0 #29231d, 0 18px 36px rgba(41, 35, 29, 0.18);
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ai-support-widget__launcher:hover {
  transform: translateY(-2px);
  background: #ffc34f;
  box-shadow: 0 6px 0 #29231d, 0 20px 42px rgba(41, 35, 29, 0.22);
}

.ai-support-widget__launcher:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #29231d, 0 12px 28px rgba(41, 35, 29, 0.16);
}

.ai-support-widget__launcher-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid #29231d;
  border-radius: 50%;
  color: #ffffff;
  background: #df2f3a;
  font-size: 18px;
  line-height: 1;
}

.ai-support-widget__launcher-text {
  font-size: 15px;
  line-height: 1;
}

.ai-support-widget__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  display: flex;
  width: min(390px, calc(100vw - 28px));
  height: min(590px, calc(100vh - 120px));
  overflow: hidden;
  flex-direction: column;
  border: 2px solid #29231d;
  border-radius: 18px;
  background: #fff8ed;
  box-shadow: 0 7px 0 #29231d, 0 28px 70px rgba(41, 35, 29, 0.2);
}

.ai-support-widget__panel::before {
  content: "";
  height: 8px;
  flex: 0 0 auto;
  background: linear-gradient(90deg, #df2f3a 0 34%, #ffb431 34% 70%, #29231d 70% 100%);
}

.ai-support-widget__panel[hidden] {
  display: none;
}

.ai-support-widget__header {
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: center;
  gap: 12px;
  padding: 15px 16px 14px;
  color: #29231d;
  background: #fff8ed;
  border-bottom: 2px solid rgba(41, 35, 29, 0.12);
}

.ai-support-widget__heading {
  min-width: 0;
}

.ai-support-widget__header strong,
.ai-support-widget__header span,
.ai-support-widget__header small {
  display: block;
}

.ai-support-widget__header strong {
  overflow: hidden;
  color: #29231d;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-support-widget__header span {
  margin-top: 3px;
  color: #6f5f4c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.ai-support-widget__header small {
  margin-top: 4px;
  color: #8b7a66;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.ai-support-widget__close {
  position: relative;
  display: block;
  width: 38px;
  height: 38px;
  border: 2px solid #29231d;
  border-radius: 50%;
  color: #ffffff;
  background: #df2f3a;
  box-shadow: 0 2px 0 #29231d;
  font-size: 0;
}

.ai-support-widget__close::before,
.ai-support-widget__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 4px;
  border-radius: 999px;
  background: #ffffff;
  transform-origin: center;
}

.ai-support-widget__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.ai-support-widget__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.ai-support-widget__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(circle at 20px 24px, rgba(255, 180, 49, 0.12) 0 2px, transparent 3px),
    linear-gradient(180deg, #fff8ed 0%, #fff4e3 100%);
}

.ai-support-widget__message {
  width: fit-content;
  max-width: 86%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 2px solid #29231d;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  text-align: left !important;
  text-indent: 0 !important;
  white-space: pre-line;
  box-shadow: 0 3px 0 rgba(41, 35, 29, 0.95);
}

.ai-support-widget__message--assistant {
  width: 86%;
  color: #29231d;
  background: #ffffff;
}

.ai-support-widget__message--user {
  margin-left: auto;
  color: #29231d;
  background: #ffffff;
}

.ai-support-widget__message--typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
}

.ai-support-widget__typing-dots {
  display: inline-flex;
  gap: 3px;
  transform: translateY(2px);
}

.ai-support-widget__typing-dots i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #29231d;
  animation: ai-support-widget-typing 900ms ease-in-out infinite;
}

.ai-support-widget__typing-dots i:nth-child(2) {
  animation-delay: 120ms;
}

.ai-support-widget__typing-dots i:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes ai-support-widget-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.ai-support-widget__message a {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  color: #df2f3a;
  cursor: pointer;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.ai-support-widget__message a:hover {
  color: #a81f28;
}

.ai-support-widget__form {
  display: flex;
  gap: 9px;
  padding: 12px;
  border-top: 2px solid rgba(41, 35, 29, 0.12);
  background: #fff8ed;
}

.ai-support-widget__link-status {
  position: absolute;
  right: 14px;
  bottom: 78px;
  left: 14px;
  display: none;
  padding: 9px 11px;
  border: 2px solid #29231d;
  border-radius: 12px;
  color: #29231d;
  background: #ffffff;
  box-shadow: 0 3px 0 #29231d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ai-support-widget__link-status.is-visible {
  display: block;
}

.ai-support-widget__rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 14px;
  border-top: 2px solid rgba(41, 35, 29, 0.1);
  background: #fff8ed;
}

.ai-support-widget__rating span {
  color: #6f5f4c;
  font-size: 12px;
  font-weight: 900;
}

.ai-support-widget__stars {
  display: flex;
  justify-content: center;
  gap: 3px;
}

.ai-support-widget__stars button {
  width: 26px;
  height: 26px;
  border: 0;
  padding: 0;
  color: #c8bba8;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 1px 0 #29231d;
}

.ai-support-widget__stars button:hover,
.ai-support-widget__stars button.is-active {
  color: #ffb431;
}

.ai-support-widget__stars button:disabled {
  cursor: default;
}

.ai-support-widget__rating-status {
  position: absolute;
  right: 14px;
  bottom: 70px;
  left: 14px;
  min-height: 13px;
  color: #df2f3a;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.ai-support-widget__form input {
  min-width: 0;
  flex: 1;
  border: 2px solid #29231d;
  border-radius: 14px;
  padding: 12px 13px;
  color: #29231d;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(41, 35, 29, 0.08);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.ai-support-widget__form input:focus {
  border-color: #df2f3a;
  box-shadow: 0 0 0 3px rgba(223, 47, 58, 0.16);
}

.ai-support-widget__form input::placeholder {
  color: #8b7a66;
}

.ai-support-widget__form button {
  min-width: 72px;
  border: 2px solid #29231d;
  border-radius: 14px;
  padding: 0 14px;
  color: #29231d;
  background: #ffb431;
  box-shadow: 0 3px 0 #29231d;
  font-weight: 900;
}

.ai-support-widget__form button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.ai-support-widget__privacy {
  margin: -3px 14px 10px;
  color: #8b7a66;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

@media (max-width: 520px) {
  .ai-support-widget {
    right: 12px;
    bottom: 12px;
  }

  .ai-support-widget__launcher {
    min-width: 88px;
    height: 54px;
    padding-right: 14px;
  }

  .ai-support-widget__panel {
    right: -4px;
    bottom: 72px;
    width: calc(100vw - 24px);
    height: min(590px, calc(100vh - 96px));
    border-radius: 16px;
  }
}
