.hl-chatbot {
  --hl-chatbot-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  --hl-chatbot-right: clamp(14px, 2vw, 24px);
  --hl-border: rgba(255, 255, 255, 0.28);
  --hl-text: #f8fbff;
  --hl-muted: rgba(235, 243, 255, 0.72);
  --hl-user-start: #2a8cff;
  --hl-user-end: #1d6ae6;
  position: fixed;
  right: var(--hl-chatbot-right);
  bottom: var(--hl-chatbot-bottom);
  z-index: 990;
  pointer-events: none;
  font-family: 'SF Pro Text', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Avenir Next', 'Segoe UI', sans-serif;
}

.hl-chatbot * {
  box-sizing: border-box;
}

.hl-chatbot__toggle {
  position: relative;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  padding: 11px 14px;
  background: linear-gradient(148deg, rgba(255, 255, 255, 0.26), rgba(160, 198, 255, 0.18) 35%, rgba(66, 138, 255, 0.38));
  backdrop-filter: blur(18px) saturate(150%);
  color: var(--hl-text);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 44px rgba(5, 10, 22, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.22s ease;
}

.hl-chatbot__toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 52px rgba(5, 10, 22, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.hl-chatbot__toggle:focus-visible {
  outline: 2px solid rgba(89, 168, 255, 0.85);
  outline-offset: 2px;
}

.hl-chatbot__toggle-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.2));
  line-height: 0;
}

.hl-chatbot__toggle-icon svg {
  width: 16px;
  height: 16px;
  fill: #0e2b53;
}

.hl-chatbot__toggle-badge {
  position: absolute;
  top: -6px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ff2d55;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 14px rgba(255, 45, 85, 0.45);
}

.hl-chatbot__toggle-badge[hidden] {
  display: none;
}

.hl-chatbot__panel {
  pointer-events: auto;
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(412px, calc(100vw - 24px));
  max-height: min(650px, 78vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 28px;
  border: 1px solid var(--hl-border);
  background: linear-gradient(165deg, rgba(188, 214, 255, 0.2), rgba(27, 37, 59, 0.84) 38%, rgba(11, 16, 25, 0.94));
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 32px 72px rgba(3, 7, 17, 0.56), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transform-origin: bottom right;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s ease;
}

.hl-chatbot__panel::before,
.hl-chatbot__panel::after {
  content: '';
  position: absolute;
  inset: auto auto 46% -24%;
  width: 64%;
  height: 48%;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.36;
  background: radial-gradient(circle, rgba(97, 184, 255, 0.9), rgba(97, 184, 255, 0));
  animation: hl-chatbot-liquid 12s ease-in-out infinite;
}

.hl-chatbot__panel::after {
  inset: 52% -20% auto auto;
  width: 58%;
  height: 44%;
  animation-duration: 15s;
  animation-delay: -4s;
  background: radial-gradient(circle, rgba(39, 135, 255, 0.95), rgba(39, 135, 255, 0));
}

.hl-chatbot[data-open='true'] .hl-chatbot__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.hl-chatbot[data-open='true'] .hl-chatbot__toggle {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.hl-chatbot__header {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
}

.hl-chatbot__title {
  margin: 0;
  color: var(--hl-text);
  font-size: 0.98rem;
  font-weight: 650;
}

.hl-chatbot__subtitle {
  margin: 2px 0 0;
  color: var(--hl-muted);
  font-size: 0.82rem;
}

.hl-chatbot__close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #edf4ff;
  font-size: 1.14rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.hl-chatbot__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hl-chatbot__messages {
  position: relative;
  z-index: 1;
  padding: 16px 14px;
  min-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hl-chatbot__messages::-webkit-scrollbar {
  width: 7px;
}

.hl-chatbot__messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
}

.hl-chatbot__message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.hl-chatbot__message-row--user {
  justify-content: flex-end;
}

.hl-chatbot__message-body {
  max-width: 83%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hl-chatbot__message-row--user .hl-chatbot__message-body {
  align-items: flex-end;
  order: 1;
}

.hl-chatbot__message-row--user .hl-chatbot__avatar {
  order: 2;
}

.hl-chatbot__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.hl-chatbot__avatar--bot {
  color: #e9f4ff;
  background: linear-gradient(145deg, rgba(91, 177, 255, 0.8), rgba(39, 117, 228, 0.9));
  border: 1px solid rgba(186, 228, 255, 0.62);
}

.hl-chatbot__avatar--user {
  color: #dcecff;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.36);
}

.hl-chatbot__message {
  border-radius: 20px;
  padding: 10px 13px;
  font-size: 0.92rem;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
  animation: hl-chatbot-bubble-in 0.22s ease;
}

.hl-chatbot__message--bot {
  color: #f4f8ff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.2), rgba(204, 224, 255, 0.06));
  backdrop-filter: blur(14px);
  border-bottom-left-radius: 8px;
}

.hl-chatbot__message--user {
  color: #f8fbff;
  border: 1px solid rgba(125, 197, 255, 0.52);
  background: linear-gradient(160deg, var(--hl-user-start), var(--hl-user-end));
  box-shadow: 0 10px 24px rgba(22, 108, 226, 0.32);
  border-bottom-right-radius: 8px;
}

.hl-chatbot__time {
  margin: 0 4px;
  color: rgba(224, 238, 255, 0.63);
  font-size: 0.67rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.hl-chatbot__message--typing {
  padding: 11px 12px;
}

.hl-chatbot__typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 28px;
  justify-content: center;
}

.hl-chatbot__typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(236, 246, 255, 0.95);
  animation: hl-chatbot-dot-pulse 1s ease-in-out infinite;
}

.hl-chatbot__typing-dot:nth-child(2) {
  animation-delay: 0.12s;
}

.hl-chatbot__typing-dot:nth-child(3) {
  animation-delay: 0.24s;
}

.hl-chatbot__footer {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, rgba(11, 16, 25, 0.12), rgba(11, 16, 25, 0.45));
  backdrop-filter: blur(16px);
}

.hl-chatbot__quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 98px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.hl-chatbot__quick-replies[hidden] {
  display: none;
}

.hl-chatbot__quick-reply {
  border: 1px solid rgba(191, 225, 255, 0.52);
  border-radius: 999px;
  background: rgba(165, 210, 255, 0.12);
  color: #e8f2ff;
  padding: 7px 11px;
  font-size: 0.78rem;
  font-weight: 570;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hl-chatbot__quick-reply:hover {
  border-color: rgba(140, 206, 255, 0.9);
  background: rgba(123, 195, 255, 0.26);
  transform: translateY(-1px);
}

.hl-chatbot__composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.hl-chatbot__input {
  min-width: 0;
  border-radius: 18px;
  border: 1px solid rgba(201, 231, 255, 0.46);
  background: rgba(235, 246, 255, 0.14);
  color: #f5f9ff;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.2;
  padding: 10px 13px;
}

.hl-chatbot__input::placeholder {
  color: rgba(233, 243, 255, 0.73);
}

.hl-chatbot__input:focus {
  outline: none;
  border-color: rgba(109, 186, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(81, 165, 252, 0.24);
}

.hl-chatbot__send {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(165deg, #46a6ff, #2274ed);
  color: #f4f9ff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 640;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(19, 99, 214, 0.36);
}

.hl-chatbot__send:hover {
  filter: brightness(1.06);
}

.hl-chatbot__handoff {
  display: block;
  text-align: center;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid rgba(132, 255, 221, 0.42);
  background: linear-gradient(155deg, rgba(0, 188, 148, 0.48), rgba(2, 132, 102, 0.72));
  color: #e9fff8;
  font-size: 0.86rem;
  font-weight: 620;
  padding: 9px 12px;
}

.hl-chatbot__handoff:hover {
  filter: brightness(1.07);
}

.hl-chatbot__send:disabled,
.hl-chatbot__input:disabled,
.hl-chatbot__quick-reply:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

@keyframes hl-chatbot-liquid {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(8%, -6%, 0) scale(1.06);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes hl-chatbot-bubble-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hl-chatbot-dot-pulse {
  0%,
  80%,
  100% {
    opacity: 0.32;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

@media (max-width: 900px) {
  .hl-chatbot {
    --hl-chatbot-right: 12px;
    --hl-chatbot-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .hl-chatbot__panel {
    width: min(410px, calc(100vw - 16px));
  }

  .hl-chatbot__toggle-label {
    display: none;
  }
}

@media (max-width: 760px) {
  .hl-chatbot {
    left: auto;
    right: 10px;
    --hl-chatbot-right: 10px;
    --hl-chatbot-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .hl-chatbot__toggle {
    margin-left: auto;
  }

  .hl-chatbot__panel {
    width: min(410px, calc(100vw - 16px));
    max-height: min(710px, 82vh);
    border-radius: 22px;
  }

  .hl-chatbot__messages {
    padding: 14px 12px;
  }

  .hl-chatbot__message-body {
    max-width: 88%;
  }

  .hl-chatbot__quick-replies {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding-bottom: 2px;
  }

  .hl-chatbot__quick-reply {
    white-space: nowrap;
    flex-shrink: 0;
  }
}
