.ai-support {
  --ai-support-accent: #7a3b00;
  --ai-support-accent-text: #fff;
  --ai-support-footer-background: #333;
  --ai-support-footer-text: #fff;
  --ai-support-footer-link: #39ff14;
  bottom: 20px;
  font-family: Arial, Helvetica, sans-serif;
  position: fixed;
  right: 20px;
  z-index: 10050;
}

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

.ai-support__launcher {
  align-items: center;
  background: var(--ai-support-accent);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  color: var(--ai-support-accent-text);
  cursor: pointer;
  display: flex;
  font-size: 26px;
  font-weight: 700;
  height: 58px;
  justify-content: center;
  margin-left: auto;
  width: 58px;
}

.ai-support__launcher:focus,
.ai-support__panel button:focus,
.ai-support__panel textarea:focus,
.ai-support__panel a:focus {
  outline: 3px solid rgba(38, 132, 255, .65);
  outline-offset: 2px;
}

.ai-support__panel {
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 14px;
  bottom: 70px;
  box-shadow: 0 12px 42px rgba(0, 0, 0, .28);
  color: #252525;
  display: flex;
  flex-direction: column;
  max-height: min(620px, calc(100vh - 120px));
  overflow: hidden;
  position: absolute;
  right: 0;
  width: min(380px, calc(100vw - 28px));
}

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

.ai-support__header {
  align-items: center;
  background: var(--ai-support-accent);
  color: var(--ai-support-accent-text);
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.ai-support__header strong,
.ai-support__header small {
  display: block;
}

.ai-support__header strong {
  font-size: 16px;
}

.ai-support__header small {
  margin-top: 2px;
  opacity: .88;
}

.ai-support__header button {
  background: transparent;
  border: 0;
  color: var(--ai-support-accent-text);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  padding: 2px 6px;
}

.ai-support__messages {
  background: #f7f7f7;
  flex: 1 1 auto;
  min-height: 220px;
  overflow-y: auto;
  padding: 14px;
}

.ai-support__message {
  border-radius: 12px;
  line-height: 1.45;
  margin-bottom: 10px;
  max-width: 88%;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-support__message--assistant {
  background: #fff;
  border: 1px solid #ddd;
  margin-right: auto;
}

.ai-support__message--user {
  background: var(--ai-support-accent);
  color: #fff;
  margin-left: auto;
}

.ai-support__message--assistant a {
  color: var(--ai-support-accent);
  display: inline;
  margin: 0;
  overflow-wrap: anywhere;
  text-decoration: underline;
}

.ai-support__new-window-icon {
  display: inline-block;
  font-size: .82em;
  font-weight: 700;
  line-height: 1;
  margin-left: .25em;
  text-decoration: none;
  vertical-align: .18em;
}

.ai-support__answer-link--internal .ai-support__new-window-icon {
  color: currentColor;
  opacity: .78;
}

.ai-support__answer-link--external .ai-support__new-window-icon {
  color: #9b2c00;
  opacity: 1;
}

.ai-support__visually-hidden {
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}

.ai-support__status {
  background: #f7f7f7;
  color: #666;
  font-size: 12px;
  min-height: 20px;
  padding: 2px 14px 5px;
}

.ai-support__form {
  align-items: flex-end;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 8px;
  padding: 10px;
}

.ai-support__form textarea {
  border: 1px solid #aaa;
  border-radius: 8px;
  flex: 1 1 auto;
  font: inherit;
  line-height: 1.35;
  max-height: 110px;
  min-height: 44px;
  padding: 9px;
  resize: vertical;
}

.ai-support__form button {
  background: var(--ai-support-accent);
  border: 0;
  border-radius: 8px;
  color: var(--ai-support-accent-text);
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 8px 14px;
}

.ai-support__form button:disabled {
  cursor: wait;
  opacity: .55;
}

.ai-support__footer {
  align-items: center;
  background: var(--ai-support-footer-background);
  border: 0;
  border-radius: 0;
  color: var(--ai-support-footer-text);
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  justify-content: center;
  line-height: 1.4;
  margin: 0;
  min-height: 38px;
  padding: 8px 10px;
  text-align: center;
}

.ai-support__footer a {
  color: var(--ai-support-footer-link);
  font-size: inherit;
  line-height: inherit;
  margin-left: .3em;
  text-decoration: underline;
}

.ai-support__footer a:hover,
.ai-support__footer a:focus {
  color: var(--ai-support-footer-link);
}

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

  .ai-support__panel {
    bottom: 66px;
    max-height: calc(100vh - 100px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-support * {
    scroll-behavior: auto !important;
  }
}
