/* CAME — globos de ayuda y chat dentro de la misma página. */
.came-assistant-launcher { appearance: none; text-align: left; cursor: pointer; }
.came-assistant-bubble {
  position: fixed;
  right: 24px;
  bottom: max(122px, calc(env(safe-area-inset-bottom) + 98px));
  z-index: 1025;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(292px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 10px 10px 10px 18px;
  border: 1px solid #ddd7e8;
  border-radius: 14px;
  background: #fff;
  color: #492f7b;
  box-shadow: 0 6px 22px rgb(37 23 62 / 12%);
  font: 500 14px/1.5 'Open Sans', Arial, sans-serif;
}
.came-assistant-bubble::after {
  content: '';
  position: absolute;
  right: 31px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid #ddd7e8;
  border-bottom: 1px solid #ddd7e8;
  background: #fff;
  transform: rotate(45deg);
}
.came-assistant-bubble p { flex: 1; margin: 0; }
.came-assistant-bubble-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #766983;
  cursor: pointer;
}
.came-assistant-bubble-close:hover { background: #f4f0f8; color: #492f7b; }
.came-assistant-bubble-close svg { width: 16px; height: 16px; }
.came-assistant-bubble-close:focus-visible { outline: 3px solid #492f7b; outline-offset: 2px; }
.came-assistant-bubble[hidden],
.came-chat-status[hidden],
.came-chat-window:not([open]) { display: none !important; }
.came-intro-active .came-assistant-bubble,
.came-chat-active .came-assistant-launcher,
.came-chat-active .came-assistant-bubble { visibility: hidden; }

.came-chat-window {
  position: fixed;
  inset: auto 24px 24px auto;
  z-index: 1040;
  box-sizing: border-box;
  width: min(444px, calc(100vw - 40px));
  height: min(840px, calc(100vh - 48px));
  height: min(840px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 1px solid #ddd7e8;
  border-radius: 18px;
  background: #fff;
  color: #30283e;
  box-shadow: 0 16px 64px rgb(37 23 62 / 25%);
  overflow: hidden;
}
.came-chat-window[open] { display: flex; flex-direction: column; }
.came-chat-header {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
  padding: 14px 16px;
  border-top: 4px solid #492f7b;
  border-bottom: 1px solid #e8e3ec;
  background: #fff;
}
.came-chat-header img { display: block; width: 72px; height: auto; flex-shrink: 0; }
.came-chat-header h2 { flex: 1; min-width: 0; margin: 0; color: #30283e; font: 600 18px/1.4 'Jost', Arial, sans-serif; }
.came-chat-header .came-dismiss { margin-left: auto; }
.came-chat-viewport { flex: 1 1 0; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable both-edges; background: #f4f6f8; }
.came-chat-canvas { position: relative; width: 420px; height: 660px; margin: 0 auto; }
.came-chat-frame { position: absolute; inset: 0 auto auto 0; display: block; width: 420px; height: 660px; max-width: none; border: 0; background: #f4f6f8; transform-origin: top left; }
.came-chat-status { flex-shrink: 0; margin: 0; padding: 9px 18px; background: #f6f3fa; color: #625270; font: 400 13px/1.5 'Open Sans', Arial, sans-serif; }
.came-chat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 14px;
  border-top: 1px solid #e8e3ec;
  background: #fff;
  font: 500 13px/1.5 'Open Sans', Arial, sans-serif;
}
.came-chat-footer a { padding: 8px 0; color: #492f7b; text-decoration: underline; text-underline-offset: 3px; }
.came-chat-footer a:focus-visible { outline: 3px solid #492f7b; outline-offset: 3px; }
.came-home .back-to-top { right: 28px; bottom: 222px; }
@media (max-width: 575.98px) {
  .came-assistant-bubble { right: 16px; bottom: max(106px, calc(env(safe-area-inset-bottom) + 90px)); width: min(264px, calc(100vw - 32px)); font-size: 13px; padding-left: 14px; }
  .came-chat-window { inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px; width: auto; height: calc(100vh - max(12px, env(safe-area-inset-bottom)) - 12px); height: calc(100dvh - max(12px, env(safe-area-inset-bottom)) - 12px); border-radius: 14px; }
  .came-chat-header { gap: 10px; padding: 12px; }
  .came-chat-header img { width: 54px; }
  .came-chat-header h2 { font-size: 16px; }
  .came-chat-header .came-dismiss { padding: 10px; }
  .came-chat-header .came-dismiss span { display: none; }
  .came-home .back-to-top { right: 20px; bottom: 194px; }
}
