#estandar-chatbot {
  --ecb-accent: #2563eb;
  --ecb-user-bubble: #e8f0fe;
  --ecb-bot-bubble: #f7f7f8;
  --ecb-radius: 16px;
  --ecb-bubble-radius: 12px;
  --ecb-float-radius: 9999px;
  --ecb-float-size: 58px;
  --ecb-bg: #ffffff;
  --ecb-bg-soft: #f7f7f8;
  --ecb-text: #1a1a1a;
  --ecb-muted: #6b7280;
  --ecb-border: #e5e7eb;
  --ecb-panel-bg: #ffffff;
  --ecb-bg-image: none;
  --ecb-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --ecb-shadow-strong: 0 8px 20px rgba(0, 0, 0, 0.08);

  position: fixed;
  bottom: 0;
  right: 0;
  left: auto;
  z-index: 2147483000;
  pointer-events: none;
}

#estandar-chatbot[data-position="left"] {
  left: 0;
  right: auto;
}

#estandar-chatbot * {
  pointer-events: auto;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

#estandar-chatbot .ecb-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  left: auto;
  width: var(--ecb-float-size);
  height: var(--ecb-float-size);
  border-radius: var(--ecb-float-radius);
  background: var(--ecb-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--ecb-shadow-strong);
  transition: all 0.2s ease;
  background-repeat: no-repeat;
}

#estandar-chatbot[data-position="left"] .ecb-float {
  left: 22px;
  right: auto;
}

#estandar-chatbot .ecb-float:hover {
  transform: translateY(-1px);
  box-shadow: var(--ecb-shadow-strong);
}

#estandar-chatbot .ecb-float__icon {
  font-size: 22px;
  line-height: 1;
}

#estandar-chatbot .ecb-float__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ef4444;
}

#estandar-chatbot .ecb-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  left: auto;
  width: min(392px, calc(100vw - 24px));
  height: min(85vh, 720px);
  max-height: 76vh;
  border-radius: var(--ecb-radius);
  border: 1px solid var(--ecb-border);
  background: var(--ecb-panel-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--ecb-shadow);
  overflow: hidden;
  display: none;
  flex-direction: column;
  transition: all 0.2s ease;
}

#estandar-chatbot[data-position="left"] .ecb-panel {
  left: 22px;
  right: auto;
}

#estandar-chatbot.ecb-inline {
  position: relative;
  bottom: auto;
  right: auto;
  left: auto;
  z-index: auto;
  pointer-events: auto;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

#estandar-chatbot.ecb-inline.ecb-inline-with-sidebar {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  align-items: stretch;
}

#estandar-chatbot.ecb-inline .ecb-float {
  display: none;
}

#estandar-chatbot.ecb-inline .ecb-panel,
#estandar-chatbot.ecb-inline[data-position="left"] .ecb-panel {
  position: relative;
  right: auto;
  left: auto;
  bottom: auto;
  width: 100%;
  max-width: 960px;
  max-height: none;
  height: var(--ecb-inline-height, 680px);
  margin: 0 auto;
  display: flex;
}

#estandar-chatbot.ecb-inline .ecb-inline-sidebar {
  display: none;
}

#estandar-chatbot.ecb-inline.ecb-inline-with-sidebar .ecb-inline-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--ecb-border);
  border-radius: 16px;
  background: rgba(248, 249, 251, 0.9);
  box-shadow: var(--ecb-shadow);
  padding: 14px;
}

#estandar-chatbot.ecb-inline .ecb-inline-sidebar__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ecb-text);
}

#estandar-chatbot.ecb-inline .ecb-inline-sidebar__btn {
  width: 100%;
  border: 1px solid var(--ecb-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ecb-text);
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

#estandar-chatbot.ecb-inline .ecb-inline-sidebar__btn:hover {
  border-color: var(--ecb-accent);
  color: #fff;
  background: var(--ecb-accent);
}

#estandar-chatbot.ecb-inline .ecb-inline-sidebar__hint {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ecb-muted);
}

#estandar-chatbot.ecb-inline .ecb-header__close {
  display: none;
}

#estandar-chatbot .ecb-header__body {
  min-width: 0;
}

#estandar-chatbot .ecb-header__meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ecb-muted);
  display: none;
}

#estandar-chatbot.ecb-inline.ecb-inline-landing .ecb-header {
  display: none;
}

#estandar-chatbot.ecb-inline.ecb-inline-landing .ecb-panel {
  justify-content: center;
  padding: 0 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#estandar-chatbot.ecb-inline.ecb-inline-landing .ecb-messages {
  flex: 0;
  max-height: none;
  overflow: visible;
  padding: 0 0 16px;
}

#estandar-chatbot.ecb-inline.ecb-inline-landing .ecb-msg {
  justify-content: center;
}

#estandar-chatbot.ecb-inline.ecb-inline-landing .ecb-msg .ecb-bubble {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #111827;
  font-size: clamp(24px, 3.2vw, 44px);
  font-weight: 500;
  line-height: 1.2;
  padding: 0;
}

#estandar-chatbot.ecb-inline.ecb-inline-landing .ecb-input {
  width: min(860px, calc(100vw - 40px));
  margin: 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

#estandar-chatbot.ecb-inline.ecb-inline-landing .ecb-input input {
  text-align: center;
}

#estandar-chatbot.ecb-inline.ecb-inline-landing .ecb-actions {
  width: min(860px, calc(100vw - 40px));
  margin: 12px auto 0;
}

#estandar-chatbot.ecb-inline.ecb-inline-landing .ecb-btnlist {
  justify-content: center;
}

#estandar-chatbot.ecb-inline.ecb-chat-started .ecb-panel {
  background: var(--ecb-panel-bg);
  border: 1px solid var(--ecb-border);
  box-shadow: 0 32px 84px rgba(15, 23, 42, 0.24);
}

#estandar-chatbot.ecb-inline.ecb-chat-started .ecb-header {
  display: flex;
}

#estandar-chatbot.ecb-inline.ecb-chat-started .ecb-messages {
  flex: 1;
  overflow: auto;
}

#estandar-chatbot.ecb-inline.ecb-inline-fixed-composer.ecb-chat-started .ecb-panel {
  position: relative;
  overflow: hidden;
}

#estandar-chatbot.ecb-inline.ecb-inline-fixed-composer.ecb-chat-started .ecb-messages {
  padding-bottom: 116px;
}

#estandar-chatbot.ecb-inline.ecb-inline-fixed-composer.ecb-chat-started .ecb-actions {
  padding-bottom: 86px;
}

#estandar-chatbot.ecb-inline.ecb-inline-fixed-composer.ecb-chat-started .ecb-input {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  border-top: 1px solid var(--ecb-border);
  background: rgba(255, 255, 255, 0.96);
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-panel,
#estandar-chatbot.ecb-inline.ecb-inline-fullpage[data-position="left"] .ecb-panel {
  width: min(720px, calc(100vw - 32px));
  max-width: 720px;
  height: min(var(--ecb-inline-height, 860px), calc(100dvh - 120px));
  min-height: 680px;
  margin: 60px auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage * {
  font-family: inherit;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage {
  width: 100%;
  padding: 0 16px 48px;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage.ecb-inline-with-sidebar {
  grid-template-columns: minmax(220px, 260px) minmax(0, 720px);
  justify-content: center;
  gap: 24px;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-inline-sidebar {
  align-self: start;
  margin-top: 60px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage.ecb-inline-landing .ecb-panel {
  justify-content: flex-start;
  padding: 32px 32px 24px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-messages {
  padding: 20px;
  min-height: 420px;
  background: transparent;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-header {
  padding: 16px 20px;
  gap: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-header__title {
  font-size: 16px;
  font-weight: 600;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-header__meta {
  font-size: 12px;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-actions {
  padding: 0 20px 12px;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-input {
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-input input {
  border-radius: 10px;
  border-color: rgba(15, 23, 42, 0.1);
  padding: 10px;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-input #ecbSend {
  border-radius: 10px;
  padding: 10px 16px;
}

#estandar-chatbot.ecb-inline.ecb-inline-fullpage.ecb-chat-started .ecb-panel {
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body.page-chatbot {
  background: #f5f7fa;
}

#estandar-chatbot .ecb-panel.ecb-panel--open {
  display: flex;
}

#estandar-chatbot .ecb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ecb-border);
  background: var(--ecb-bg);
  transition: all 0.2s ease;
}

#estandar-chatbot .ecb-header__title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--ecb-text);
}

#estandar-chatbot .ecb-header__close,
#estandar-chatbot .ecb-header__reset,
#estandar-chatbot .ecb-header__menu,
#estandar-chatbot .ecb-header__human {
  border: 1px solid transparent;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--ecb-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

#estandar-chatbot .ecb-header__close:hover,
#estandar-chatbot .ecb-header__reset:hover,
#estandar-chatbot .ecb-header__menu:hover,
#estandar-chatbot .ecb-header__human:hover {
  border-color: var(--ecb-border);
  background: rgba(15, 23, 42, 0.12);
}

#estandar-chatbot .ecb-messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 18px;
  background: var(--ecb-bg);
  background-image: var(--ecb-bg-image);
  background-size: cover;
  background-position: center;
}

#estandar-chatbot .ecb-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

#estandar-chatbot .ecb-msg--user {
  justify-content: flex-end;
}

#estandar-chatbot .ecb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 28px;
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

#estandar-chatbot .ecb-bubble {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: var(--ecb-bubble-radius);
  font-size: 14px;
  line-height: 1.4;
  transition: all 0.2s ease;
}

#estandar-chatbot .ecb-msg--bot .ecb-bubble {
  background: var(--ecb-bot-bubble);
  border: 1px solid var(--ecb-border);
  color: var(--ecb-text);
}

#estandar-chatbot .ecb-msg--bot .ecb-bubble a {
  color: var(--ecb-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

#estandar-chatbot .ecb-msg--bot .ecb-bubble .ecb-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 0;
  background: var(--ecb-accent);
  color: #fff;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  transition: all 0.2s ease;
}

#estandar-chatbot .ecb-msg--bot .ecb-bubble .ecb-link-btn:hover {
  filter: brightness(0.96);
}

#estandar-chatbot .ecb-msg--user .ecb-bubble {
  background: var(--ecb-user-bubble);
  color: var(--ecb-text);
  border: 1px solid rgba(37, 99, 235, 0.08);
}

#estandar-chatbot .ecb-actions {
  padding: 0 14px 10px;
}

#estandar-chatbot .ecb-btnlist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#estandar-chatbot .ecb-btn {
  border: 1px solid var(--ecb-border);
  background: #fff;
  color: var(--ecb-text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.16s ease;
}

#estandar-chatbot .ecb-btn:hover {
  background: var(--ecb-accent);
  color: #fff;
  border-color: var(--ecb-accent);
}

#estandar-chatbot .ecb-progress-bar {
  height: 4px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 0 0 2px 2px;
  overflow: hidden;
}

#estandar-chatbot .ecb-progress-bar::before {
  content: "";
  display: block;
  height: 100%;
  width: var(--ecb-progress, 0%);
  background: var(--ecb-accent);
  transition: width 0.25s ease;
}

#estandar-chatbot .ecb-input {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--ecb-border);
  background: var(--ecb-bg);
  transition: all 0.2s ease;
}

#estandar-chatbot .ecb-input > input,
#estandar-chatbot .ecb-input > #ecbSend {
  position: relative;
  z-index: 1;
}

#estandar-chatbot .ecb-input::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  height: 44px;
  border: 1px solid var(--ecb-border);
  border-radius: 999px;
  background: var(--ecb-bg-soft);
}

#estandar-chatbot .ecb-input input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 14px !important;
  background: transparent;
  color: var(--ecb-text);
}

#estandar-chatbot .ecb-input input::placeholder {
  color: var(--ecb-muted);
}

#estandar-chatbot .ecb-input input:focus {
  outline: none;
  box-shadow: none;
}

#estandar-chatbot .ecb-input__human-wrap {
  flex: 0 0 100%;
  order: 100;
  margin-top: 6px;
  text-align: center;
}

#estandar-chatbot .ecb-human-btn {
  font-size: 12px;
  color: var(--ecb-accent);
  background: transparent;
  border: 1px dashed var(--ecb-accent);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#estandar-chatbot .ecb-human-btn:hover {
  background: var(--ecb-accent);
  color: #fff;
  border-style: solid;
}

#estandar-chatbot .ecb-input #ecbSend {
  border: none;
  border-radius: 999px;
  background: var(--ecb-accent);
  color: #fff;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 0;
  cursor: pointer;
  flex: 0 0 36px;
  transition: all 0.2s ease;
}

#estandar-chatbot .ecb-input #ecbSend:hover {
  filter: brightness(0.96);
}

#estandar-chatbot .ecb-input #ecbSend::before {
  content: "➤";
  font-size: 16px;
  line-height: 1;
}

#estandar-chatbot .ecb-human-btn::before,
#estandar-chatbot .ecb-human-btn::after {
  content: none;
}

#estandar-chatbot .ecb-dot {
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 999px;
  display: inline-block;
  background: #94a3b8;
  animation: ecbDot 1s infinite ease-in-out;
}

#estandar-chatbot .ecb-dot:nth-child(2) { animation-delay: 0.15s; }
#estandar-chatbot .ecb-dot:nth-child(3) { animation-delay: 0.3s; margin-right: 0; }

@keyframes ecbDot {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 640px) {
  #estandar-chatbot .ecb-float {
    right: 14px;
    bottom: 14px;
  }

  #estandar-chatbot[data-position="left"] .ecb-float {
    left: 14px;
    right: auto;
  }

  #estandar-chatbot .ecb-panel {
    right: 12px;
    top: max(env(safe-area-inset-top, 0px), 0px);
    bottom: max(env(safe-area-inset-bottom, 0px), 0px);
    width: calc(100vw - 24px);
    height: calc(var(--vh, 1vh) * 100);
    max-height: calc(var(--vh, 1vh) * 100);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 18px;
  }

  #estandar-chatbot[data-position="left"] .ecb-panel {
    left: 12px;
    right: auto;
  }

  #estandar-chatbot.ecb-inline.ecb-inline-with-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  #estandar-chatbot.ecb-inline.ecb-inline-with-sidebar .ecb-inline-sidebar {
    order: 2;
  }

  #estandar-chatbot.ecb-inline.ecb-inline-fullpage {
    padding: 0 10px 24px;
  }

  #estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-panel,
  #estandar-chatbot.ecb-inline.ecb-inline-fullpage[data-position="left"] .ecb-panel {
    width: min(100%, calc(100vw - 20px));
    height: min(var(--ecb-inline-height, 860px), calc(100dvh - 32px));
    min-height: 620px;
    margin: 16px auto;
    border-radius: 14px;
  }

  #estandar-chatbot.ecb-inline.ecb-inline-fullpage.ecb-inline-landing .ecb-panel {
    padding: 24px 18px 18px;
  }

  #estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-messages {
    padding: 16px;
    min-height: 360px;
  }

  #estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-actions {
    padding: 0 16px 10px;
  }

  #estandar-chatbot.ecb-inline.ecb-inline-fullpage .ecb-input {
    padding: 10px;
  }

  #estandar-chatbot .ecb-header__close,
  #estandar-chatbot .ecb-header__reset,
  #estandar-chatbot .ecb-header__menu,
  #estandar-chatbot .ecb-header__human {
    width: 44px;
    height: 44px;
  }

  #estandar-chatbot .ecb-input input {
    font-size: 16px !important;
    min-height: 44px;
  }

  #estandar-chatbot .ecb-input #ecbSend {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  #estandar-chatbot .ecb-btn,
  #estandar-chatbot.ecb-inline .ecb-inline-sidebar__btn,
  #estandar-chatbot .ecb-human-btn,
  #estandar-chatbot .ecb-msg--bot .ecb-bubble .ecb-link-btn {
    min-height: 44px;
  }
}
