.hybrid-web-ai-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999;
  font-family: inherit;
}

.hybrid-web-ai,
.hybrid-web-ai * {
  box-sizing: border-box;
}

.hybrid-web-ai {
  color: #0f172a !important;
}

.hybrid-web-ai__toggle {
  appearance: none;
  border: 0 !important;
  border-radius: 999px;
  min-width: 62px;
  min-height: 62px;
  padding: 0 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: #ffffff !important;
  background: linear-gradient(135deg, #5b46ff 0%, #4328f5 100%) !important;
  box-shadow: 0 20px 50px rgba(26, 35, 126, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hybrid-web-ai__toggle:hover,
.hybrid-web-ai__toggle:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 24px 55px rgba(26, 35, 126, 0.36);
  outline: none;
}

.hybrid-web-ai__panel {
  width: min(390px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 110px));
  margin-top: 14px;
  border-radius: 26px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
}

.hybrid-web-ai.is-open .hybrid-web-ai__panel {
  display: flex;
}

.hybrid-web-ai__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 16px;
  background: linear-gradient(135deg, #5b46ff 0%, #4328f5 100%) !important;
  color: #ffffff !important;
}

.hybrid-web-ai__header-content {
  min-width: 0;
}

.hybrid-web-ai__title {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.hybrid-web-ai__close {
  appearance: none;
  border: 0 !important;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}

.hybrid-web-ai__close:hover,
.hybrid-web-ai__close:focus-visible {
  background: rgba(255, 255, 255, 0.22) !important;
  outline: none;
}

.hybrid-web-ai__messages {
  flex: 1;
  padding: 18px !important;
  overflow-y: auto;
  background: linear-gradient(180deg, #f8faff 0%, #f3f5fb 100%) !important;
}

.hybrid-web-ai__messages::-webkit-scrollbar {
  width: 8px;
}

.hybrid-web-ai__messages::-webkit-scrollbar-thumb {
  background: rgba(67, 40, 245, 0.25);
  border-radius: 999px;
}

.hybrid-web-ai__message {
  max-width: 88%;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
  word-break: break-word;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.hybrid-web-ai__message--bot {
  background: #ffffff !important;
  color: #1f2937 !important;
  border-top-left-radius: 8px;
}

.hybrid-web-ai__message--user {
  margin-left: auto;
  background: linear-gradient(135deg, #5b46ff 0%, #4328f5 100%) !important;
  color: #ffffff !important;
  border-top-right-radius: 8px;
}

.hybrid-web-ai__sources {
  margin: -2px 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hybrid-web-ai__source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none !important;
  background: rgba(91, 70, 255, 0.1) !important;
  color: #4328f5 !important;
  font-size: 12px;
  font-weight: 700;
}

.hybrid-web-ai__quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 14px;
}

.hybrid-web-ai__quick-action {
  appearance: none;
  border: 1px solid rgba(91, 70, 255, 0.16) !important;
  background: #ffffff !important;
  color: #1f2937 !important;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hybrid-web-ai__quick-action:hover,
.hybrid-web-ai__quick-action:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(91, 70, 255, 0.34) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  outline: none;
}

.hybrid-web-ai__composer {
  padding: 14px !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff !important;
}

.hybrid-web-ai__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.hybrid-web-ai__input {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 54px;
  max-height: 130px;
  resize: vertical;
  margin: 0 !important;
  padding: 14px 16px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  background: #f8fafc !important;
  color: #111827 !important;
  caret-color: #4328f5;
  font: inherit;
  line-height: 1.5;
  box-shadow: none !important;
}

.hybrid-web-ai__input::placeholder {
  color: #6b7280 !important;
  opacity: 1;
}

.hybrid-web-ai__input:focus {
  outline: none;
  border-color: rgba(67, 40, 245, 0.38) !important;
  box-shadow: 0 0 0 4px rgba(67, 40, 245, 0.1) !important;
  background: #ffffff !important;
}

.hybrid-web-ai__submit {
  appearance: none;
  border: 0 !important;
  border-radius: 18px;
  min-width: 96px;
  min-height: 54px;
  padding: 0 18px;
  cursor: pointer;
  color: #ffffff !important;
  background: linear-gradient(135deg, #5b46ff 0%, #4328f5 100%) !important;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 16px 28px rgba(67, 40, 245, 0.24);
}

.hybrid-web-ai__submit:hover,
.hybrid-web-ai__submit:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.hybrid-web-ai__typing {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: #475569 !important;
}

.hybrid-web-ai-admin .notice {
  max-width: 960px;
}

@media (max-width: 680px) {
  .hybrid-web-ai-root {
    right: 10px;
    bottom: 10px;
  }

  .hybrid-web-ai__panel {
    width: min(100vw - 12px, 390px);
    height: min(80vh, 640px);
    border-radius: 22px;
  }

  .hybrid-web-ai__toggle {
    min-width: 56px;
    min-height: 56px;
    padding: 0 18px;
  }

  .hybrid-web-ai__form {
    grid-template-columns: 1fr 88px;
  }
}
