#alb-ai-chat-popup {
  position: fixed;
  top: var(--alb-ai-chat-top, 24px);
  right: max(16px, env(safe-area-inset-right));
  bottom: auto;
  left: auto;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: var(--alb-ai-chat-height, 560px);
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #0e385f;
  border-radius: 0;
  background: #fff;
  color: #222;
  box-shadow: 0 12px 48px rgb(7 40 72 / 28%);
  z-index: 2147483000;
}

#alb-ai-chat-popup:not([open]) {
  display: none;
}

#alb-ai-chat-popup[open] {
  display: flex;
  flex-direction: column;
}

#alb-ai-chat-popup .alb-ai-chat-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 16px;
  min-height: 48px;
  padding: 4px 8px 4px 16px;
  background: #0e385f;
}

#alb-ai-chat-popup #alb-ai-chat-popup-title {
  margin: 0;
  padding: 0;
  color: #fff;
  font: 700 16px/1.4 "Montserrat", sans-serif;
  letter-spacing: normal;
  text-transform: none;
}

#alb-ai-chat-popup .alb-ai-chat-popup-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: 400 30px/1 sans-serif;
  cursor: pointer;
}

#alb-ai-chat-popup .alb-ai-chat-popup-close:hover,
#alb-ai-chat-popup .alb-ai-chat-popup-close:focus-visible {
  background: #bf8e5a;
  color: #fff;
}

#alb-ai-chat-popup .alb-ai-chat-popup-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

#alb-ai-chat-popup iframe {
  display: block;
  flex: 1 1 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

#alb-ai-chat-popup[data-chat-ready="true"] iframe {
  opacity: 1;
  pointer-events: auto;
}

#alb-ai-chat-popup .alb-ai-chat-popup-loading {
  position: absolute;
  inset: 48px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: #fff;
  color: #0e385f;
  font: 400 14px/1.5 "Montserrat", sans-serif;
  text-align: center;
}

#alb-ai-chat-popup[data-chat-ready="true"] .alb-ai-chat-popup-loading {
  display: none;
}

#alb-ai-chat-popup .alb-ai-chat-popup-retry {
  padding: 10px 18px;
  border: 0;
  border-radius: 0;
  background: #0e385f;
  color: #fff;
  font: 700 14px/1.5 "Montserrat", sans-serif;
  cursor: pointer;
}

#alb-ai-chat-popup .alb-ai-chat-popup-retry[hidden] {
  display: none;
}

@media (max-width: 480px) {
  #alb-ai-chat-popup {
    right: max(8px, env(safe-area-inset-right));
    max-width: calc(100vw - 16px);
  }
}
