#kratos-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  font-family: Arial, sans-serif;
}

#kratos-chat-open {
  min-width: 70px;
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 26px;
  background: #0036ad;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

#kratos-chat-window {
  position: absolute;
  right: 0;
  bottom: 65px;
  width: 360px;
  max-width: calc(100vw - 30px);
  overflow: hidden;
  border: 1px solid #d9d9d9;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.22);
}

#kratos-chat-window[hidden] {
  display: none;
}

.kratos-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #0036ad;
  color: #ffffff;
}

#kratos-chat-close {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.kratos-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 320px;
  padding: 15px;
  overflow-y: auto;
  background: #f4f6f9;
}

.kratos-chat-message {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.kratos-chat-assistant {
  align-self: flex-start;
  background: #ffffff;
  color: #1e293b;
}

.kratos-chat-user {
  align-self: flex-end;
  background: #0036ad;
  color: #ffffff;
}

#kratos-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

#kratos-chat-question {
  flex: 1;
  min-height: 44px;
  max-height: 100px;
  padding: 10px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}

#kratos-chat-send {
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: #0036ad;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

#kratos-chat-send:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.kratos-chat-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  #kratos-chat {
    right: 12px;
    bottom: 12px;
  }

  #kratos-chat-window {
    position: fixed;
    right: 10px;
    bottom: 75px;
    left: 10px;
    width: auto;
  }

  .kratos-chat-messages {
    height: 55vh;
  }

  .kratos-chat-sources {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffffff;
    font-size: 13px;
  }

  .kratos-chat-sources a {
    color: #0036ad;
    text-decoration: underline;
  }
}
