/* Idrak AI Chat Widget - layout reset + mobile width fix */

html.idrak-chat-lock,
body.idrak-chat-lock {
  overflow: hidden !important;
}

#idrak-chat-widget {
  all: initial;
  position: fixed !important;
  right: 24px !important;
  bottom: 24px !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  z-index: 2147483000 !important;
  font-family: inherit !important;
  line-height: normal !important;
  pointer-events: auto !important;
  isolation: isolate !important;
}

#idrak-chat-widget,
#idrak-chat-widget * {
  box-sizing: border-box !important;
}

#idrak-chat-button {
  all: initial;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  min-height: 48px !important;
  padding: 14px 22px !important;
  background: #05B7A5 !important;
  color: #0B0F14 !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28) !important;
  text-align: center !important;
  white-space: nowrap !important;
}

#idrak-chat-button:hover {
  transform: translateY(-1px) !important;
}

#idrak-chat-box {
  position: relative !important;
  display: none;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 380px !important;
  max-width: calc(100vw - 32px) !important;
  height: min(540px, calc(100dvh - 96px)) !important;
  max-height: calc(100svh - 96px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  background: #0B0F14 !important;
  color: #ffffff !important;
  border: 1px solid rgba(5, 183, 165, 0.38) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45) !important;
  pointer-events: auto !important;
}

#idrak-chat-header {
  all: initial;
  flex: 0 0 auto !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 16px !important;
  background: #132A4A !important;
  color: #ffffff !important;
  font-family: inherit !important;
}

#idrak-chat-header > div {
  display: block !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

#idrak-chat-header strong {
  all: initial;
  display: block !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: #ffffff !important;
  white-space: normal !important;
}

#idrak-chat-header span {
  all: initial;
  display: block !important;
  margin-top: 3px !important;
  font-family: inherit !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  color: #8A94A6 !important;
  white-space: normal !important;
}

#idrak-chat-close {
  all: initial;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  background: transparent !important;
  color: #ffffff !important;
  border: 0 !important;
  font-family: inherit !important;
  font-size: 28px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

#idrak-chat-messages {
  flex: 1 1 auto !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  padding: 16px !important;
  background: radial-gradient(circle at top left, rgba(5, 183, 165, 0.12), transparent 35%), #0B0F14 !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  touch-action: none !important;
  scrollbar-width: thin !important;
}

.idrak-chat-message {
  display: block !important;
  width: fit-content !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 11px 13px !important;
  border-radius: 14px !important;
  margin: 0 0 10px 0 !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  hyphens: auto !important;
  text-align: left !important;
}

.idrak-chat-message.bot {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border-top-left-radius: 4px !important;
  margin-right: auto !important;
}

.idrak-chat-message.user {
  background: #05B7A5 !important;
  color: #0B0F14 !important;
  border-top-right-radius: 4px !important;
  margin-left: auto !important;
  max-width: 86% !important;
}

#idrak-chat-form {
  all: initial;
  flex: 0 0 auto !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 12px !important;
  background: #132A4A !important;
  font-family: inherit !important;
}

#idrak-chat-input {
  all: initial;
  flex: 1 1 auto !important;
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 42px !important;
  max-height: 96px !important;
  padding: 11px 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  outline: none !important;
  resize: none !important;
  overflow-y: auto !important;
  white-space: pre-wrap !important;
  overflow-wrap: break-word !important;
}

#idrak-chat-input::placeholder {
  color: #8A94A6 !important;
  opacity: 1 !important;
}

#idrak-chat-form button {
  all: initial;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 64px !important;
  min-height: 42px !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #ED6D40 !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  text-align: center !important;
  white-space: nowrap !important;
}

#idrak-chat-form button:disabled,
#idrak-chat-input:disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
}

@media (max-width: 767px) {
  #idrak-chat-widget {
    right: 12px !important;
    bottom: 12px !important;
    left: auto !important;
    top: auto !important;
  }

  #idrak-chat-box {
    width: min(320px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    height: min(470px, calc(var(--idrak-chat-viewport-height, 100svh) - 84px)) !important;
    max-height: calc(var(--idrak-chat-viewport-height, 100svh) - 84px) !important;
    border-radius: 16px !important;
  }

  #idrak-chat-header {
    padding: 13px 14px !important;
  }

  #idrak-chat-header strong {
    font-size: 14px !important;
  }

  #idrak-chat-header span {
    font-size: 11px !important;
  }

  #idrak-chat-messages {
    padding: 14px !important;
  }

  .idrak-chat-message {
    font-size: 13.5px !important;
    max-width: 100% !important;
  }

  .idrak-chat-message.user {
    max-width: 88% !important;
  }

  #idrak-chat-form {
    padding: 10px !important;
  }


  #idrak-chat-input {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
    overflow-y: auto !important;
    resize: none !important;
  }

  #idrak-chat-form {
    align-items: center !important;
  }

  #idrak-chat-form button {
    min-width: 58px !important;
    padding: 0 13px !important;
  }
}

@media (max-width: 350px) {
  #idrak-chat-box {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
  }

  #idrak-chat-widget {
    right: 10px !important;
    bottom: 10px !important;
  }
}
