.od-chatbot-root {
  --od-chatbot-viewport-height: 100dvh;
  --od-chatbot-viewport-top: 0px;
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 10020;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  transition: bottom 0.24s ease;
}

html.od-chatbot-mobile-open,
body.od-chatbot-mobile-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.od-chatbot-root.od-chatbot-has-scroll-top {
  bottom: 96px;
}

.od-chatbot-root.is-open.od-chatbot-has-scroll-top {
  bottom: 96px;
}

.od-chatbot-launcher {
  position: relative;
}

.od-chatbot-button {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  overflow: hidden;
  background: #081126;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.24);
  transform: translateZ(0);
  will-change: transform, box-shadow;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  isolation: isolate;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.od-chatbot-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.26);
}

.od-chatbot-button:focus-visible,
.od-chatbot-panel-close:focus-visible,
.od-chatbot-language-button:focus-visible,
.od-chatbot-send:focus-visible,
.od-chatbot-textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(20, 46, 241, 0.28);
}

.od-chatbot-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: translateZ(0) scale(1.01);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  image-rendering: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.od-chatbot-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.od-chatbot-status {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #2dd36f;
  box-shadow: 0 0 0 4px rgba(45, 211, 111, 0.16);
}

.od-chatbot-status::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid rgba(45, 211, 111, 0.42);
  animation: od-chatbot-pulse 1.8s ease-out infinite;
}

.od-chatbot-bubble {
  position: absolute;
  top: 8px;
  right: calc(100% + 12px);
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #ffffff;
  color: #081126;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease;
}

.od-chatbot-root.is-open .od-chatbot-bubble {
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
}

.od-chatbot-panel {
  width: 450px;
  max-width: calc(100vw - 56px);
  height: 650px;
  max-height: min(650px, calc(100vh - 120px));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(8, 17, 38, 0.99), rgba(4, 10, 24, 0.99));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.96);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease,
    visibility 0.24s ease;
  overscroll-behavior: contain;
}

.od-chatbot-root.is-open .od-chatbot-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.od-chatbot-panel[hidden] {
  display: none;
}

.od-chatbot-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.od-chatbot-panel-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.od-chatbot-panel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

.od-chatbot-panel-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: translateZ(0) scale(1.01);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  image-rendering: auto;
}

.od-chatbot-panel-title {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.15;
}

.od-chatbot-panel-status {
  margin: 6px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1;
}

.od-chatbot-panel-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2dd36f;
  box-shadow: 0 0 0 4px rgba(45, 211, 111, 0.12);
}

.od-chatbot-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.od-chatbot-language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.od-chatbot-language-button {
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.od-chatbot-language-button:hover,
.od-chatbot-language-button.is-active {
  background: rgba(20, 46, 241, 0.92);
  color: #ffffff;
}

.od-chatbot-language-button:hover {
  transform: translateY(-1px);
}

.od-chatbot-panel-close {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease;
}

.od-chatbot-panel-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.od-chatbot-panel-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(20, 46, 241, 0.08), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0));
}

.od-chatbot-messages {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  overscroll-behavior: contain;
}

.od-chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.od-chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.od-chatbot-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 82%;
}

.od-chatbot-message-user {
  align-self: flex-end;
  align-items: flex-end;
}

.od-chatbot-message-bot {
  align-self: flex-start;
  align-items: flex-start;
}

.od-chatbot-message-bubble {
  padding: 12px 14px;
  border-radius: 20px;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.65;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

.od-chatbot-message-bubble-user {
  background: linear-gradient(135deg, #142ef1 0%, #2441ff 100%);
  color: #ffffff;
  border-bottom-right-radius: 8px;
}

.od-chatbot-message-bubble-bot {
  background: rgba(255, 255, 255, 0.94);
  color: #081126;
  border-bottom-left-radius: 8px;
}

.od-chatbot-message-time {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  line-height: 1;
  padding: 0 4px;
}

.od-chatbot-message-user .od-chatbot-message-time {
  text-align: right;
}

.od-chatbot-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.od-chatbot-action {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.od-chatbot-action:hover {
  border-color: rgba(142, 174, 254, 0.34);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateY(-1px);
}

.od-chatbot-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(20, 46, 241, 0.28);
}

.od-chatbot-action:disabled {
  opacity: 0.54;
  cursor: not-allowed;
  transform: none;
}

.od-chatbot-action-primary {
  border-color: rgba(20, 46, 241, 0.46);
  background: #142ef1;
  color: #ffffff;
}

.od-chatbot-action-primary:hover {
  background: #2441ff;
  border-color: rgba(142, 174, 254, 0.5);
}

.od-chatbot-summary {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 2px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.od-chatbot-summary-row {
  display: grid;
  gap: 3px;
}

.od-chatbot-summary-row span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.od-chatbot-summary-row strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  word-break: break-word;
}

.od-chatbot-typing {
  position: static;
  pointer-events: none;
}

.od-chatbot-message-bubble-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
}

.od-chatbot-message-bubble-typing span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(8, 17, 38, 0.36);
  animation: od-chatbot-typing 1s ease-in-out infinite;
}

.od-chatbot-message-bubble-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.od-chatbot-message-bubble-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.od-chatbot-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.od-chatbot-textarea {
  width: 100%;
  min-height: 54px;
  max-height: 120px;
  resize: none;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  overflow-y: auto;
}

.od-chatbot-textarea::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.od-chatbot-send {
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #142ef1;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 36px rgba(20, 46, 241, 0.28);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
  flex: 0 0 auto;
}

.od-chatbot-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(20, 46, 241, 0.34);
  background: #2441ff;
}

.od-chatbot-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@keyframes od-chatbot-pulse {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes od-chatbot-typing {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .od-chatbot-root {
    right: 18px;
    bottom: 18px;
  }

  .od-chatbot-root.is-open {
    left: 0;
    right: 0;
    top: var(--od-chatbot-viewport-top, 0px);
    bottom: auto;
    width: 100%;
    height: var(--od-chatbot-viewport-height, 100dvh);
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    align-items: stretch;
    justify-content: flex-end;
    gap: 0;
  }

  .od-chatbot-root.od-chatbot-has-scroll-top {
    bottom: 76px;
  }

  .od-chatbot-root.is-open.od-chatbot-has-scroll-top {
    bottom: auto;
  }

  .od-chatbot-button {
    width: 56px;
    height: 56px;
  }

  .od-chatbot-bubble {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .od-chatbot-root.is-open .od-chatbot-launcher {
    display: none;
  }

  .od-chatbot-panel {
    width: min(450px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    height: min(650px, calc(100vh - 104px));
    max-height: calc(100vh - 104px);
  }

  .od-chatbot-root.is-open .od-chatbot-panel {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 26px;
    transform-origin: bottom center;
  }

  .od-chatbot-panel-body {
    padding: 14px;
  }

  .od-chatbot-panel-header {
    gap: 10px;
    padding: 16px 16px 14px;
    align-items: flex-start;
  }

  .od-chatbot-language-toggle {
    padding: 3px;
  }

  .od-chatbot-language-button {
    min-width: 30px;
    height: 28px;
    padding: 0 8px;
  }

  .od-chatbot-panel-title {
    font-size: 16px;
  }

  .od-chatbot-panel-status {
    margin-top: 4px;
    font-size: 12px;
  }

  .od-chatbot-message {
    max-width: 88%;
  }

  .od-chatbot-composer {
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .od-chatbot-textarea {
    min-height: 50px;
    max-height: 96px;
    padding: 13px 14px;
  }

  .od-chatbot-send {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

}
