.ai-assistant-trigger {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  border: 0;
  padding: 16px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  color: #ffffff;
  background: #f39504;
  box-shadow: 0 16px 35px rgba(3, 37, 43, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ai-assistant-trigger:hover {
  background: #ff7a54;
}

.ai-assistant-trigger__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-assistant-trigger__icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.ai-assistant-trigger__text {
  display: inline;
  white-space: nowrap;
}

.ai-assistant-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
}

.ai-assistant-modal.is-open {
  display: block;
}

.ai-assistant-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 24, 0.55);
  backdrop-filter: blur(6px);
}

.ai-assistant-modal__panel {
  position: absolute;
  right: 24px;
  bottom: 90px;
  width: min(420px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 120px));
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(8, 18, 24, 0.35);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.ai-assistant-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: #f4f6f8;
  border-bottom: 1px solid #e2e8ee;
}

.ai-assistant-modal__title {
  font-size: 14px;
  font-weight: 700;
  color: #0b3b4a;
}

.ai-assistant-modal__subtitle {
  font-size: 12px;
  color: #5c6a73;
}

.ai-assistant-modal__close {
  border: 0;
  background: transparent;
  color: #0b3b4a;
  font-weight: 600;
  cursor: pointer;
}

.ai-assistant-modal__messages {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  background: #ffffff;
}

.ai-assistant-message {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
}

.ai-assistant-message--assistant {
  align-self: flex-start;
  background: #f0f5f7;
  color: #0b3b4a;
}

.ai-assistant-message--user {
  align-self: flex-end;
  background: #f39504;
  color: #ffffff;
}

.ai-assistant-message--assistant a {
  color: #0f6d74;
  text-decoration: underline;
}

.ai-assistant-message--assistant ul,
.ai-assistant-message--assistant ol {
  padding-left: 18px;
  margin: 8px 0 0;
}

.ai-assistant-message--assistant code {
  background: #e8eef2;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
}

.ai-assistant-message--typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-assistant-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0f6d74;
  animation: ai-assistant-pulse 1s ease-in-out infinite;
}

.ai-assistant-typing-text {
  font-weight: 600;
}

.ai-assistant-typing-ellipsis {
  display: inline-block;
  overflow: hidden;
  width: 0;
  white-space: nowrap;
  animation: ai-assistant-ellipsis 1.2s steps(3, end) infinite;
}

@keyframes ai-assistant-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

@keyframes ai-assistant-ellipsis {
  0% {
    width: 0;
  }
  50% {
    width: 3ch;
  }
  100% {
    width: 0;
  }
}

@keyframes ai-assistant-bounce {
  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  70% {
    transform: translateY(-5px);
  }
}

.ai-assistant-modal__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid #e2e8ee;
  background: #f9fafb;
}

.ai-assistant-modal__input {
  resize: none;
  border-radius: 12px;
  border: 1px solid #d7e0e6;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

.ai-assistant-modal__input:focus {
  outline: none;
  border-color: #0f6d74;
  box-shadow: 0 0 0 3px rgba(15, 109, 116, 0.12);
}

.ai-assistant-modal__send {
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  background: #f39504;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.ai-assistant-modal__send:hover {
  background: #ff7a54;
}

.ai-assistant-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ai-assistant-choice {
  border: 1px solid #f39504;
  background: #fff4f0;
  color: #a64a2f;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ai-assistant-choice:hover {
  background: #ffe5dd;
}

@media (max-width: 600px) {
  .ai-assistant-trigger {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    gap: 0;
    justify-content: center;
    align-items: center;
    animation: ai-assistant-bounce 2.4s ease-in-out infinite;
    transform-origin: center bottom;
  }

  .ai-assistant-trigger__text {
    display: none;
  }

  .ai-assistant-trigger__icon {
    width: 22px;
    height: 22px;
    margin: 0;
  }

  .ai-assistant-trigger__icon svg {
    width: 22px;
    height: 22px;
  }

  .ai-assistant-modal__panel {
    right: 16px;
    bottom: 80px;
    width: calc(100vw - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-assistant-trigger {
    animation: none;
  }
}
