.bot-launch {
  position: fixed;
  bottom: 18px;
  right: 0;
  margin-right: env(safe-area-inset-right, 0px);
  border: none;
  padding: 0;
  background: transparent;
  display: grid;
  align-items: end;
  justify-items: end;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 2000;
  overflow: visible;
  touch-action: manipulation;
}
.bot-launch:focus {
  outline: none;
}
.bot-launch-pill {
  grid-area: 1 / 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 22px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  border-radius: 999px 0 0 999px;
  min-height: 52px;
  box-shadow: 0 18px 40px rgba(68, 21, 92, 0.25);
  transform: translateX(130%);
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.28s ease,
    box-shadow 0.28s ease;
  pointer-events: none;
  will-change: transform;
  width: fit-content;
  justify-self: flex-end;
}
.bot-launch-pill:not(.is-visible) {
  position: absolute;
  right: 0;
  top: 0;
}
.bot-launch-pill.is-visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  width: fit-content;
}
.bot-launch-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.bot-launch-pill.is-visible::before {
  opacity: 1;
}
.bot-launch-logo {
  display: block;
  height: 24px !important;
  width: auto;
}
.bot-launch-icon {
  width: auto;
  height: 24px;
  flex-shrink: 0;
  border-radius: 12px;
  display: block;
  object-fit: contain;
  box-shadow: 0 10px 22px rgba(18, 18, 36, 0.18);
}
.bot-launch-pill--brand {
  position: relative;
  padding-right: 28px;
  padding-block: 14px;
  min-height: 52px;
}
.bot-launch-pill--prompt {
  position: relative;
  font-weight: 500;
  border-radius: 999px 0 0 999px;
}
.bot-launch-text {
  font-size: 14px;
  white-space: nowrap;
}

.bot-launch:focus-visible .bot-launch-pill.is-visible {
  box-shadow: 0 0 0 3px rgba(123, 92, 255, 0.35), 0 14px 32px rgba(32, 29, 54, 0.2);
}

@media (max-width: 540px) {
  .bot-launch-pill {
    padding: 12px 18px;
    gap: 10px;
    min-height: 48px;
  }
  .bot-launch-pill--brand {
    padding-right: 24px;
    padding-block: 14px;
    min-height: 52px;
  }
  .bot-launch-logo {
    height: 32px;
  }
  .bot-launch-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
  }
  .bot-launch-text {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bot-launch-pill {
    transition: none;
  }
}

.bot-overlay {
  position: fixed;
  inset: 0;
  --bot-header-height: 0px;
  --bot-bottom-offset: 0px;
  --bot-viewport-height: 100vh;
  padding: calc(var(--bot-header-height, 0px) + env(safe-area-inset-top, 0px)) 0 calc(env(safe-area-inset-bottom, 0px) + var(--bot-bottom-offset, 0px));
  background: rgba(32, 29, 54, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2100;
}
.bot-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.bot-dialog {
  width: 100%;
  max-width: none;
  max-height: none;
  height: calc(var(--bot-viewport-height, 100vh) - var(--bot-header-height, 0px));
  margin-top: 0;
  background: linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)), url("../../img/bot/chat-bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  transform: translateY(0);
  transition: transform 0.35s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: var(--bot-suggestions-height, 0px);
}
.bot-overlay.is-active .bot-dialog {
  transform: translateY(0);
}
.bot-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 2;
  padding: 24px 28px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  background: rgba(0, 0, 0, 0.75);
  margin: 0;
  box-shadow: none;
  border-radius: 0;
}
.bot-avatar {
  max-width: clamp(150px, 32vw, 220px);
  height: auto;
  display: block;
  border: none;
  border-radius: 0;
}
.bot-header-actions {
  display: flex;
  align-items: center;
  margin-left: 16px;
  flex-shrink: 0;
}
.bot-header-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgb(255 255 255 / 12%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-blanco);
  font-size: 20px;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.bot-header-btn:hover {
  background: rgba(15, 23, 42, 0.16);
}
.bot-header-btn-close {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.bot-header-btn:focus-visible {
  outline: 3px solid rgba(168, 231, 214, 0.9);
  outline-offset: 3px;
}
.bot-header-btn i {
  line-height: 1;
}
.bot-feed {
  flex: 1;
  padding: 0 28px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
}
.bot-message {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 1px 15px rgba(28, 30, 47, 0.30);
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  
}
.bot-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.96);
  color: #23243d;
  border-bottom-left-radius: 8px;
}
.bot-user {
  align-self: flex-end;
  background: #c9f4d9;
  color: #10442a;
  border-bottom-right-radius: 8px;
  text-align: right;
  white-space: pre-wrap;
}
.bot-message a {
  color: #214099;
  text-decoration: underline;
  word-break: break-word;
}
.bot-suggestions {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 16px 24px 16px;
  background: #f2f7f9;
  display: block;
  box-shadow: 0 -18px 38px rgba(32, 29, 54, 0.12);
  z-index: 1;
}

.bot-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.bot-quick-actions.is-hidden {
  display: none;
}

.bot-quick-action {
  border: none;
  background: #ffffff;
  color: #1f2339;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(33, 64, 153, 0.16);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;
}

.bot-quick-action:hover,
.bot-quick-action:focus {
  background: #214099;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(33, 64, 153, 0.2);
  transform: translateY(-1px);
}

.bot-quick-action:focus-visible {
  outline: 3px solid rgba(168, 231, 214, 0.9);
  outline-offset: 2px;
}

.bot-input {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(125, 128, 163, 0.22);
  width: 100%;
  box-sizing: border-box;
}
.bot-input-field {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 16px 18px;
  font-size: 16px;
  color: #1f2339;
}
.bot-input-field:focus {
  outline: none;
}
.bot-input-send {
  border: none;
  background: transparent;
  padding: 0 18px 0 8px;
  color: #7b7d9b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.bot-input-send:focus-visible {
  outline: 3px solid rgba(168, 231, 214, 0.9);
  outline-offset: 4px;
}
.bot-overlay {
  display: flex;
}

@media (max-width: 640px) {
  .bot-suggestions {
    padding: 14px 16px 16px;
  }
}

@media (min-width: 641px) {
  .bot-launch {
    display: none;
  }
  .bot-overlay {
    --bot-vertical-padding: 24px;
    --bot-horizontal-padding: 24px;
    align-items: center;
    padding: calc(var(--bot-header-height, 0px) + var(--bot-vertical-padding, 24px)) var(--bot-horizontal-padding, 24px) calc(var(--bot-vertical-padding, 24px) + var(--bot-bottom-offset, 0px));
    display: none;
  }
  .bot-dialog {
    max-width: 680px;
    max-height: min(720px, calc(100vh - (var(--bot-vertical-padding, 24px) * 2)));
    height: 70vh;
    margin-top: var(--bot-header-height, 0px);
    box-shadow: 0 -12px 48px rgba(32, 29, 54, 0.28);
    transform: translateY(36px);
  }
  .bot-overlay.is-active .bot-dialog {
    transform: translateY(0);
  }
  .bot-header {
    padding: 24px 28px;
    min-height: auto;
    margin: 0;
  }
}
body.bot-lock {
  overflow: hidden;
  touch-action: none;
}
