
#bai-popup-window-stack {
  margin-right: 5px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
  width: min(94vw, 620px);
  max-width: min(94vw, 620px);
}
#bai-popup-window-stack[data-align="left"] {
  width: min(90vw, 620px);
  max-width: min(90vw, 620px);
  margin-right: 0;
  margin-left: 0;
}
.bai-popup-feedback {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.bai-popup-feedback-label {
  font-size: 12px;
  color: #475569;
}
.bai-popup-feedback-input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 64px;
  color: inherit;
  background: #ffffff;
  cursor: text;
}
.bai-popup-feedback-input:focus {
  outline: none;
  /* Match main app input focus (with safe fallbacks) */
  border-color: var(--color-border-secondary, var(--color-text-primary, #0f172a));
  box-shadow: 0 0 0 2px var(--color-bg-hover, rgba(15, 23, 42, 0.10));
}
.bai-popup-feedback-actions {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}
.bai-popup-feedback-submit {
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 24px;
  /* Match CRM "Besøg/Visit" button sizing (TertiaryButton inline styles in src/admin/DialList.jsx) */
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  color: #0f172a;
  background: #f3f4f6;
  box-shadow: none;
  height: 32px;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.bai-popup-feedback-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.bai-popup-feedback-submit:not(:disabled):hover {
  background: #e5e7eb;
  border-color: rgba(15, 23, 42, 0.24);
}
.bai-popup-feedback-submit:not(:disabled):active {
  transform: scale(0.98);
}
  @keyframes bai-popup-window-enter {
    0% {
      opacity: 0;
      transform: translateY(14px) scale(0.9);
    }
    70% {
      opacity: 1;
      transform: translateY(-2px) scale(1.02);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
  .bai-popup-window {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid oklch(0.92 0.004 286.32);
    padding: 18px 22px 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    color: #0f172a;
    font-family: var(--chat-font, "Arial", sans-serif);
    font-size: 14px;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
    color-scheme: light;
    width: auto;
    position: relative;
  }
  .bai-popup-window:not(.bai-popup-rating) {
    max-width: min(92vw, 520px);
    width: fit-content;
  }
  .bai-popup-window.bai-popup-rating {
    /* Width ≈ (5 * 42px stars) + (4 * 8px gaps) + (22px * 2 padding) = 286px */
    max-width: min(90vw, 314px);
    width: auto;
  }
  .bai-popup-clickable {
    cursor: pointer !important;
    background: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 8px 12px 9px;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
    color: #0f172a;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }
  .bai-popup-clickable .bai-popup-window-message,
  .bai-popup-clickable > *:not(.bai-popup-stack-close) {
    cursor: pointer !important;
    color: var(--color-theme-assistant-message-text, #0f172a);
  }
  .bai-popup-clickable .bai-popup-window-message {
    font-weight: 400;
  }
  .bai-popup-clickable:hover,
  .bai-popup-clickable:focus-within {
    background: var(--color-theme-user-message, #f1f5f9) !important;
    color: var(--color-theme-user-message-text, #0f172a);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  }
  .bai-popup-clickable:hover .bai-popup-window-message,
  .bai-popup-clickable:hover > *:not(.bai-popup-stack-close),
  .bai-popup-clickable:focus-within .bai-popup-window-message,
  .bai-popup-clickable:focus-within > *:not(.bai-popup-stack-close) {
    color: var(--color-theme-user-message-text, #0f172a);
  }
  .bai-popup-clickable:hover:has(.bai-popup-stack-close:hover),
  .bai-popup-clickable:focus-within:has(.bai-popup-stack-close:focus-visible) {
    background: #ffffff !important;
    transform: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  }
  .bai-popup-clickable:hover:has(.bai-popup-stack-close:hover) .bai-popup-window-message,
  .bai-popup-clickable:hover:has(.bai-popup-stack-close:hover) > *:not(.bai-popup-stack-close),
  .bai-popup-clickable:focus-within:has(.bai-popup-stack-close:focus-visible) .bai-popup-window-message,
  .bai-popup-clickable:focus-within:has(.bai-popup-stack-close:focus-visible) > *:not(.bai-popup-stack-close) {
    color: var(--color-theme-assistant-message-text, #0f172a);
  }
  .bai-popup-clickable .bai-popup-window-message::after {
    display: inline-block;
    margin-left: 6px;
    font-weight: bold;
    opacity: 0.75;
  }
  .bai-popup-window-enter {
    animation: bai-popup-window-enter 0.35s ease forwards;
  }
  .bai-popup-window-visible {
    opacity: 1;
    transform: translateY(0);
  }
  .bai-popup-window-exit {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
    pointer-events: none;
  }
  .bai-popup-window-message {
    flex: 0 1 auto;
    white-space: pre-line;
    word-break: break-word;
    text-align: left;
    width: auto;
    max-width: 100%;
    padding-right: 0;
    font-weight: 600;
    line-height: 1.55;
  }
  .bai-popup-window.bai-popup-rating .bai-popup-window-message {
    width: 100%;
  }
  .bai-popup-stars {
    display: flex;
    gap: 8px;
    justify-content: center;
  }
  .bai-popup-star {
    border: none;
    background: transparent;
    font-size: 42px;
    cursor: pointer;
    color: #d4d4d8;
    transition: transform 0.15s ease, color 0.15s ease;
    padding: 0;
    line-height: 1;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
  }
  .bai-popup-star[data-hover="true"],
  .bai-popup-star[data-active="true"] {
    color: #fbbf24;
    transform: scale(1.15);
  }
  .bai-popup-star svg {
    width: 1em;
    height: 1em;
    pointer-events: none;
  }
  .bai-popup-star:disabled {
    cursor: default;
    opacity: 0.35;
    transform: scale(1);
  }
  .bai-popup-stack-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid oklch(0.88 0.004 286.32);
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    color: #64748b;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: none;
    transition: opacity 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    pointer-events: none;
    z-index: calc(var(--bai-chatbot-z-index, 25) + 2);
  }
  #bai-popup-window-stack:hover .bai-popup-stack-close,
  #bai-popup-window-stack:focus-within .bai-popup-stack-close {
    opacity: 1;
    pointer-events: auto;
  }
  .bai-popup-stack-close:hover,
  .bai-popup-stack-close:focus-visible {
    background: var(--color-theme-header, #0f172a);
    border-color: var(--color-theme-header, #0f172a);
    color: var(--color-theme-header-text, #ffffff);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  }
  .bai-popup-stack-close.bai-popup-close-hidden {
    display: none !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
  @media (max-width: 768px) {
    .bai-popup-stack-close:not(.bai-popup-close-hidden) {
      opacity: 1 !important;
      pointer-events: auto !important;
    }
  }
  