body.chatbot-fullscreen-open {
  overflow: hidden;
}

.site-chatbot {
  --chatbot-width: min(440px, calc(100vw - 28px));
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 130;
  font-family: var(--font-main);
}

.chatbot-launcher {
  position: relative;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(240, 207, 122, 0.38);
  border-radius: 999px;
  padding: 10px 16px 10px 10px;
  background: rgba(7, 17, 31, 0.82);
  color: var(--color-ink);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28), 0 0 36px rgba(215, 181, 109, 0.14);
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(18px);
  transition: transform var(--transition), border-color var(--transition);
}

.chatbot-launcher:hover,
.chatbot-launcher:focus-visible,
.site-chatbot.has-cue .chatbot-launcher {
  border-color: rgba(240, 207, 122, 0.68);
  transform: translateY(-3px);
}

.chatbot-launcher__halo {
  position: absolute;
  inset: -60%;
  background: radial-gradient(circle at 70% 20%, rgba(240, 207, 122, 0.22), transparent 42%);
  animation: chatbotHalo 6s ease-in-out infinite;
}

.chatbot-launcher__mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-strong));
  color: #101015;
  font-size: 0.78rem;
  font-weight: 900;
}

.chatbot-launcher__text {
  position: relative;
  color: var(--color-soft);
  font-weight: 900;
}

.chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(560px, calc(100vw - 28px));
  height: min(760px, calc(100vh - 112px));
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  border: 1px solid rgba(246, 241, 232, 0.14);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at var(--chatbot-x, 78%) var(--chatbot-y, 20%), rgba(215, 181, 109, 0.14), transparent 18rem),
    linear-gradient(145deg, rgba(16, 31, 53, 0.96), rgba(5, 12, 24, 0.98));
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.97);
  transform-origin: bottom right;
  visibility: hidden;
  overflow: hidden;
  backdrop-filter: blur(20px);
  transition: opacity 260ms ease, transform 360ms cubic-bezier(0.16, 1, 0.3, 1), visibility 260ms ease;
}

.site-chatbot.is-open .chatbot-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.site-chatbot.is-fullscreen .chatbot-panel {
  position: fixed;
  inset: 18px;
  width: auto;
  height: auto;
  transform-origin: center;
}

.chatbot-light {
  position: absolute;
  inset: -15% -10% auto auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 207, 122, 0.15), transparent 68%);
  pointer-events: none;
}

.chatbot-header,
.chatbot-context,
.chatbot-composer {
  position: relative;
  z-index: 1;
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid rgba(246, 241, 232, 0.1);
  background: rgba(246, 241, 232, 0.035);
}

.chatbot-header h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
  white-space: nowrap;
}

.chatbot-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--color-soft);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.chatbot-status span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #58d68d;
  box-shadow: 0 0 16px rgba(88, 214, 141, 0.7);
}

.chatbot-header__actions,
.chatbot-context__links,
.chatbot-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.chatbot-header button,
.chatbot-context button,
.chatbot-toolbar button,
.chatbot-upload,
.chatbot-suggestions button {
  border: 1px solid rgba(246, 241, 232, 0.13);
  border-radius: var(--radius-sm);
  background: rgba(246, 241, 232, 0.06);
  color: var(--color-soft);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.chatbot-header button,
.chatbot-context button,
.chatbot-toolbar button,
.chatbot-upload {
  min-height: 36px;
  padding: 8px 10px;
}

.chatbot-toolbar button,
.chatbot-upload {
  height: 42px;
  min-width: 74px;
  margin: 0;
  box-sizing: border-box;
  align-self: center;
}

.chatbot-upload {
  line-height: 1;
  text-align: center;
  vertical-align: top;
}

.chatbot-header button:hover,
.chatbot-context button:hover,
.chatbot-toolbar button:hover,
.chatbot-upload:hover,
.chatbot-suggestions button:hover {
  border-color: rgba(240, 207, 122, 0.45);
  background: rgba(215, 181, 109, 0.1);
  transform: translateY(-1px);
}

.chatbot-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(246, 241, 232, 0.08);
}

.chatbot-context span {
  flex: 0 0 auto;
  color: var(--color-gold-strong);
  font-size: 0.8rem;
  font-weight: 900;
}

.chatbot-header__actions button,
.chatbot-context__links button {
  white-space: nowrap;
}

.chatbot-video {
  position: absolute;
  right: 18px;
  top: 124px;
  z-index: 4;
  width: 170px;
  border: 1px solid rgba(246, 241, 232, 0.16);
  border-radius: var(--radius-md);
  padding: 8px;
  background: rgba(7, 17, 31, 0.76);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.chatbot-video video {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.chatbot-video span {
  display: block;
  margin-top: 6px;
  color: var(--color-soft);
  font-size: 0.75rem;
  font-weight: 800;
}

.chatbot-messages {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chatbot-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  animation: chatbotMessage 260ms ease both;
}

.chatbot-message.user {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.chatbot-message.user .chatbot-avatar {
  grid-column: 2;
}

.chatbot-message.user .chatbot-bubble {
  grid-column: 1;
  grid-row: 1;
  margin-left: auto;
  background: rgba(215, 181, 109, 0.1);
}

.chatbot-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 181, 109, 0.34);
  border-radius: 50%;
  background: rgba(215, 181, 109, 0.12);
  color: var(--color-gold-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.chatbot-bubble {
  width: fit-content;
  max-width: min(100%, 620px);
  border: 1px solid rgba(246, 241, 232, 0.13);
  border-radius: var(--radius-md);
  padding: 14px 15px;
  background: rgba(246, 241, 232, 0.06);
  color: var(--color-muted);
}

.chatbot-bubble strong {
  display: block;
  margin-bottom: 5px;
  color: var(--color-gold-strong);
  font-size: 0.82rem;
}

.chatbot-bubble p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.chatbot-typing .chatbot-bubble p {
  display: inline-flex;
  gap: 5px;
}

.chatbot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-gold-strong);
  animation: chatbotTyping 900ms ease-in-out infinite;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: 120ms;
}

.chatbot-typing span:nth-child(3) {
  animation-delay: 240ms;
}

.chatbot-suggestions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 12px;
  overflow: hidden;
}

.chatbot-suggestions button {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 999px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.chatbot-file-preview {
  padding: 0 18px 12px;
}

.chatbot-file-card {
  border: 1px solid rgba(240, 207, 122, 0.24);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(215, 181, 109, 0.08);
}

.chatbot-file-card span,
.chatbot-file-card strong,
.chatbot-file-card small {
  display: block;
}

.chatbot-file-card span {
  color: var(--color-gold-strong);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chatbot-file-card strong {
  color: var(--color-ink);
}

.chatbot-file-card small {
  color: var(--color-muted);
}

.chatbot-composer {
  display: grid;
  gap: 10px;
  margin: 0 18px 18px;
  border: 1px solid rgba(246, 241, 232, 0.14);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(3, 9, 17, 0.6);
}

.chatbot-composer textarea {
  min-height: 44px;
  max-height: 132px;
  border: 0;
  padding: 4px;
  background: transparent;
  resize: none;
}

.chatbot-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chatbot-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chatbot-send {
  margin-left: auto;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-strong)) !important;
  color: #101015 !important;
}

.site-chatbot.is-thinking .chatbot-status span,
.site-chatbot.is-listening .chatbot-status span {
  animation: chatbotPulse 900ms ease-in-out infinite;
}

@keyframes chatbotHalo {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes chatbotMessage {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chatbotTyping {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

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

@keyframes chatbotPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.35);
  }
}

@media (max-width: 700px) {
  .site-chatbot {
    right: 14px;
    bottom: 14px;
  }

  .chatbot-panel,
  .site-chatbot.is-fullscreen .chatbot-panel {
    position: fixed;
    inset: 8px;
    width: auto;
    height: auto;
  }

  .chatbot-launcher__text {
    display: none;
  }

  .chatbot-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chatbot-header__actions,
  .chatbot-context,
  .chatbot-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .chatbot-header__actions,
  .chatbot-context__links,
  .chatbot-toolbar {
    flex-wrap: wrap;
  }

  .chatbot-context__links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chatbot-suggestions {
    grid-template-columns: 1fr;
  }

  .chatbot-video {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    margin: 12px 18px 0;
  }

  .chatbot-send {
    margin-left: 0;
  }
}
