.laysbot-root,
.laysbot-root * {
  box-sizing: border-box;
}

.laysbot-root {
  --lb-header: #11133f;
  --lb-header-2: #171955;
  --lb-accent: #6d76ff;
  --lb-accent-soft: #eef0ff;
  --lb-bg: #f5f7fb;
  --lb-panel: rgba(255,255,255,.94);
  --lb-card: #ffffff;
  --lb-bot-bubble: #f0f1f5;
  --lb-user-bubble: #1f245e;
  --lb-user-text: #ffffff;
  --lb-text: #18202a;
  --lb-muted: #778090;
  --lb-border: rgba(21, 31, 61, .10);
  --lb-shadow: 0 30px 80px rgba(17,19,63,.24);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Arial, sans-serif;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  color: var(--lb-text);
  -webkit-font-smoothing: antialiased;
}

.laysbot-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 18px 8px 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #171955 0%, #10123d 100%);
  color: #fff;
  box-shadow: 0 20px 40px rgba(17, 19, 63, .32);
  cursor: pointer;
}

.laysbot-toggle-avatar,
.laysbot-avatar,
.laysbot-mini-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
  color: #171955;
  font-weight: 700;
}

.laysbot-toggle-avatar {
  width: 42px;
  height: 42px;
  position: relative;
}

.laysbot-toggle-avatar::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
  border: 2px solid #171955;
}

.laysbot-toggle-avatar img,
.laysbot-avatar img,
.laysbot-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.laysbot-toggle-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.laysbot-panel {
  width: min(410px, calc(100vw - 22px));
  height: min(690px, calc(100vh - 92px));
  margin-top: 12px;
  margin-left: auto;
  border-radius: 26px;
  overflow: hidden;
  background: var(--lb-panel);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: var(--lb-shadow);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}

.laysbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 16px;
  color: #fff;
  background: linear-gradient(180deg, var(--lb-header-2) 0%, var(--lb-header) 100%);
}

.laysbot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.laysbot-avatar {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.laysbot-title {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.03em;
}

.laysbot-subtitle {
  margin-top: 3px;
  font-size: 12px;
  opacity: .78;
}

.laysbot-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.laysbot-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 16px 10px;
  background: linear-gradient(180deg, #f7f9fc 0%, #f3f5fb 100%);
}

.laysbot-message {
  display: flex;
  margin-bottom: 12px;
}

.laysbot-message-bot {
  gap: 10px;
  align-items: flex-start;
}

.laysbot-message-user {
  justify-content: flex-end;
}

.laysbot-mini-avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
  border: 1px solid rgba(23, 25, 85, .10);
  margin-top: 4px;
}

.laysbot-bubble {
  max-width: 84%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--lb-border);
  background: var(--lb-bot-bubble);
  color: var(--lb-text);
  font-size: 15px;
  line-height: 1.55;
  box-shadow: 0 8px 24px rgba(25, 33, 61, .04);
}

.laysbot-message-user .laysbot-bubble {
  background: var(--lb-user-bubble);
  color: var(--lb-user-text);
  border-color: rgba(255,255,255,.12);
}

.laysbot-track-card {
  margin-top: 12px;
  padding: 14px 14px 4px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(20, 24, 72, .08);
}

.laysbot-track-card > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(20, 24, 72, .07);
}

.laysbot-track-card > div:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 6px;
}

.laysbot-track-card span {
  font-size: 12px;
  color: var(--lb-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.laysbot-track-card strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--lb-text);
}

.laysbot-history {
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(20, 24, 72, .08);
}

.laysbot-history summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 700;
}

.laysbot-history summary::-webkit-details-marker {
  display: none;
}

.laysbot-history-item {
  padding: 0 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.laysbot-history-item + .laysbot-history-item {
  padding-top: 12px;
  border-top: 1px solid rgba(20, 24, 72, .08);
}

.laysbot-history-item span,
.laysbot-history-item small {
  color: var(--lb-muted);
}

.laysbot-footer {
  padding: 12px 16px 16px;
  background: rgba(255,255,255,.92);
  border-top: 1px solid rgba(20, 24, 72, .08);
  backdrop-filter: blur(12px);
}

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

.laysbot-action {
  border: 1px solid rgba(20,24,72,.10);
  background: #fff;
  color: #1e2653;
  border-radius: 999px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 6px 18px rgba(18,20,65,.06);
}

.laysbot-action:hover {
  transform: translateY(-1px);
  background: var(--lb-accent-soft);
  box-shadow: 0 10px 24px rgba(18,20,65,.09);
}

.laysbot-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 14px;
  border: 1px solid rgba(20,24,72,.16);
  border-radius: 999px;
  background: #fff;
}

.laysbot-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--lb-text);
}

.laysbot-input::placeholder {
  color: #9ca3af;
}

.laysbot-send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #6f76ff 0%, #4f57df 100%);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(79, 87, 223, .30);
}

.laysbot-dots {
  display: inline-flex;
  gap: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

.laysbot-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #667085;
  animation: laysbot-bounce 1.2s infinite ease-in-out;
}

.laysbot-dots i:nth-child(2) { animation-delay: .15s; }
.laysbot-dots i:nth-child(3) { animation-delay: .30s; }

@keyframes laysbot-bounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .5; }
  40% { transform: scale(1); opacity: 1; }
}

.laysbot-root.laysbot-open .laysbot-toggle {
  display: none;
}

@media (max-width: 640px) {
  .laysbot-root {
    right: 12px;
    bottom: 12px;
  }

  .laysbot-panel {
    width: calc(100vw - 16px);
    height: min(82vh, 720px);
  }

  .laysbot-bubble {
    max-width: 88%;
  }

  .laysbot-toggle-text {
    display: none;
  }

  .laysbot-toggle {
    padding-right: 8px;
  }
}


/* Refinamientos 1.0.3: iconos Dashicons de WordPress + animaciones */
.laysbot-panel {
  transform-origin: right bottom;
  animation: laysbot-panel-in .24s cubic-bezier(.2, .8, .2, 1);
}

@keyframes laysbot-panel-in {
  from {
    transform: translateY(16px) scale(.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.laysbot-toggle {
  animation: laysbot-toggle-in .35s cubic-bezier(.2, .8, .2, 1), laysbot-soft-float 4.8s ease-in-out infinite 1s;
}

@keyframes laysbot-toggle-in {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes laysbot-soft-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.laysbot-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.laysbot-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .16);
}

.laysbot-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.laysbot-action .dashicons {
  width: 17px;
  height: 17px;
  font-size: 17px;
  line-height: 17px;
  color: #5861df;
  flex: 0 0 auto;
}

.laysbot-action-primary {
  background: linear-gradient(180deg, #171955 0%, #10123d 100%);
  color: #fff;
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 14px 28px rgba(17, 19, 63, .20);
}

.laysbot-action-primary .dashicons {
  color: #fff;
}

.laysbot-action-whatsapp {
  background: linear-gradient(180deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 14px 28px rgba(18, 140, 126, .22);
}

.laysbot-action-whatsapp .dashicons {
  color: #fff;
}

.laysbot-close {
  transition: transform .16s ease, background .16s ease;
}

.laysbot-close:hover {
  transform: rotate(90deg);
  background: rgba(255,255,255,.16);
}

.laysbot-send {
  transition: transform .16s ease, box-shadow .16s ease;
}

.laysbot-send:hover {
  transform: translateX(1px) scale(1.03);
  box-shadow: 0 16px 28px rgba(79, 87, 223, .38);
}


/* Refinamientos 1.0.4 */
.laysbot-panel[hidden] {
  display: none !important;
}

.laysbot-toggle {
  width: 62px !important;
  height: 62px !important;
  min-height: 62px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  justify-content: center !important;
  gap: 0 !important;
  background: linear-gradient(180deg, #171955 0%, #10123d 100%) !important;
  box-shadow: 0 18px 34px rgba(17, 19, 63, .34) !important;
}

.laysbot-toggle-avatar {
  width: 46px !important;
  height: 46px !important;
}

.laysbot-help-bubble {
  position: absolute;
  right: 72px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 10px 14px;
  border-radius: 18px 18px 5px 18px;
  background: #fff;
  color: #171955;
  font-size: 14px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -.01em;
  box-shadow: 0 14px 30px rgba(17, 19, 63, .18);
  border: 1px solid rgba(17, 19, 63, .08);
}

.laysbot-help-bubble::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%) rotate(45deg);
  background: #fff;
  border-top: 1px solid rgba(17, 19, 63, .08);
  border-right: 1px solid rgba(17, 19, 63, .08);
}

.laysbot-toggle:hover .laysbot-help-bubble {
  transform: translateY(-50%) translateX(-2px);
}

.laysbot-close {
  background: transparent !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  box-shadow: none !important;
  border-radius: 999px !important;
  font-size: 26px !important;
}

.laysbot-close:hover {
  background: rgba(255,255,255,.13) !important;
  color: #fff !important;
  transform: rotate(90deg) !important;
}

.laysbot-action {
  border-radius: 999px !important;
}

.laysbot-form {
  border-radius: 999px !important;
}

.laysbot-input {
  border-radius: 999px !important;
}

.laysbot-send {
  border-radius: 999px !important;
}

.laysbot-panel {
  border-radius: 28px !important;
}

.laysbot-header {
  border-radius: 28px 28px 0 0 !important;
}

@media (max-width: 640px) {
  .laysbot-help-bubble {
    right: 70px;
    max-width: calc(100vw - 100px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


/* Refinamientos 1.0.5: globo exterior, cierre centrado y vista abierta más clara */
.laysbot-root {
  right: 24px;
  bottom: 24px;
}

.laysbot-toggle {
  overflow: visible !important;
  isolation: isolate;
}

.laysbot-toggle-avatar {
  overflow: visible !important;
  box-shadow:
    0 0 0 5px #fff,
    0 18px 34px rgba(17, 19, 63, .26) !important;
}

.laysbot-toggle-avatar img,
.laysbot-toggle-avatar > span {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.laysbot-toggle-avatar::after {
  right: -3px !important;
  bottom: -3px !important;
  width: 14px !important;
  height: 14px !important;
  border: 3px solid #fff !important;
  background: #25d366 !important;
  box-shadow: 0 0 0 2px rgba(37, 211, 102, .18), 0 4px 10px rgba(18, 140, 126, .32);
  z-index: 3;
}

.laysbot-help-bubble {
  right: 78px !important;
  padding: 12px 16px !important;
  border-radius: 20px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(246,248,255,.98) 100%) !important;
  color: #171955 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: -.02em !important;
  box-shadow:
    0 18px 38px rgba(17, 19, 63, .18),
    inset 0 1px 0 rgba(255,255,255,.92) !important;
  border: 1px solid rgba(17, 19, 63, .09) !important;
}

.laysbot-help-bubble::after {
  right: -6px !important;
  width: 16px !important;
  height: 16px !important;
  background: linear-gradient(135deg, rgba(246,248,255,.98), rgba(255,255,255,.98)) !important;
  border: 1px solid rgba(17, 19, 63, .08) !important;
  border-left: 0 !important;
  border-bottom: 0 !important;
}

.laysbot-panel {
  height: min(650px, calc(100vh - 110px)) !important;
  background: #f7f8fc !important;
}

.laysbot-header {
  min-height: 82px;
  padding: 16px 18px !important;
}

.laysbot-messages {
  padding: 18px 16px 8px !important;
  flex: 0 0 auto !important;
  max-height: 165px !important;
  min-height: 108px !important;
  overflow-y: auto !important;
  background:
    radial-gradient(circle at 15% 0%, rgba(109,118,255,.08), transparent 32%),
    linear-gradient(180deg, #f7f8fc 0%, #f4f6fb 100%) !important;
  border-bottom: 1px solid rgba(20,24,72,.06);
}

.laysbot-message {
  margin-bottom: 0 !important;
}

.laysbot-message + .laysbot-message {
  margin-top: 10px !important;
}

.laysbot-bubble {
  max-width: calc(100% - 38px) !important;
  border-radius: 20px !important;
}

.laysbot-footer {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 16px 16px !important;
  background: #fff !important;
}

.laysbot-quick-actions {
  flex: 1 1 auto;
  align-content: flex-start;
  overflow-y: auto;
  padding: 2px 2px 8px;
  margin-bottom: 12px !important;
}

.laysbot-quick-actions.laysbot-menu-actions::before {
  content: "Selecciona una opción";
  width: 100%;
  display: block;
  margin: 0 0 4px 2px;
  color: #7b8293;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.laysbot-action {
  border-radius: 999px !important;
  padding: 12px 15px !important;
  background: #f4f5f8 !important;
  border: 1px solid rgba(20,24,72,.06) !important;
}

.laysbot-action:hover {
  background: #eceeff !important;
}

.laysbot-action-primary {
  background: linear-gradient(180deg, #171955 0%, #10123d 100%) !important;
  color: #fff !important;
}

.laysbot-action-whatsapp {
  background: linear-gradient(180deg, #25d366 0%, #128c7e 100%) !important;
  color: #fff !important;
}

.laysbot-form {
  flex: 0 0 auto;
  padding: 6px 8px 6px 14px !important;
  border-radius: 28px !important;
  background: #fff !important;
  border: 1px solid rgba(20,24,72,.12) !important;
  box-shadow: 0 12px 28px rgba(20,24,72,.06);
}

.laysbot-input {
  height: 40px;
}

.laysbot-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 30px !important;
  font-weight: 300 !important;
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  border-radius: 50% !important;
}

.laysbot-close:hover {
  background: rgba(255,255,255,.16) !important;
}

.laysbot-close:focus-visible,
.laysbot-action:focus-visible,
.laysbot-send:focus-visible,
.laysbot-toggle:focus-visible {
  outline: 3px solid rgba(109,118,255,.32);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .laysbot-root {
    right: 14px;
    bottom: 14px;
  }

  .laysbot-help-bubble {
    right: 76px !important;
    font-size: 13px !important;
    padding: 11px 14px !important;
  }

  .laysbot-panel {
    height: min(78vh, 680px) !important;
  }

  .laysbot-messages {
    max-height: 150px !important;
  }
}


/* Refinamientos 1.0.6: menú más compacto sin hacerlo pequeño */
.laysbot-footer {
  padding: 12px 16px 16px !important;
}

.laysbot-quick-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px !important;
  align-content: flex-start !important;
  overflow-y: auto !important;
}

.laysbot-quick-actions.laysbot-menu-actions::before {
  grid-column: 1 / -1;
  margin-bottom: 0 !important;
}

.laysbot-action {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px !important;
  border-radius: 18px !important;
  justify-content: flex-start;
  font-size: 14px !important;
  line-height: 1.18 !important;
  white-space: normal;
  text-align: left;
}

.laysbot-action .dashicons {
  width: 18px !important;
  height: 18px !important;
  font-size: 18px !important;
  line-height: 18px !important;
}

.laysbot-action span:not(.dashicons) {
  min-width: 0;
}

.laysbot-action-primary,
.laysbot-action-whatsapp {
  grid-column: 1 / -1;
}

.laysbot-form {
  margin-top: 4px;
}

@media (max-width: 360px) {
  .laysbot-quick-actions {
    grid-template-columns: 1fr;
  }

  .laysbot-action {
    min-height: 46px;
  }
}


/* Refinamientos 1.0.7: bajar la división y evitar gran bloque vacío en el footer */
.laysbot-panel {
  display: flex;
  flex-direction: column;
}

.laysbot-messages {
  flex: 1 1 auto !important;
  max-height: none !important;
  min-height: 170px !important;
  overflow-y: auto !important;
}

.laysbot-footer {
  flex: 0 0 auto !important;
  min-height: auto !important;
  padding-top: 12px !important;
}

.laysbot-quick-actions {
  flex: 0 0 auto !important;
  max-height: 230px !important;
  overflow-y: auto !important;
  margin-bottom: 10px !important;
}

.laysbot-form {
  margin-top: 0 !important;
}

@media (max-width: 640px) {
  .laysbot-messages {
    min-height: 180px !important;
  }

  .laysbot-quick-actions {
    max-height: 240px !important;
  }
}


/* Refinamientos 1.0.8 */
.laysbot-action span:not(.dashicons){overflow-wrap:anywhere;}
