  /* Overlay */
  .custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    outline: none; /* We'll focus() this */
  }
  .custom-popup-overlay.active {
    display: flex;
  }

  /* Animations */
  @keyframes custom-popup-pop-in {
    0% {
      opacity: 0;
      transform: scale(0.8);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }

  @keyframes custom-popup-pop-out {
    0% {
      opacity: 1;
      transform: scale(1);
    }
    100% {
      opacity: 0;
      transform: scale(0.8);
    }
  }

  /* Popup box */
  .custom-popup-box {
    background: #fff;
    border-radius: 8px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;

    /* Start invisible, will be animated in */
    opacity: 0;
    transform: scale(0.8);
    animation-fill-mode: forwards;
  }

  /* Popup animations */
  .custom-popup-box.pop-in {
    animation-name: custom-popup-pop-in;
    animation-duration: 0.25s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }

  .custom-popup-box.pop-out {
    animation-name: custom-popup-pop-out;
    animation-duration: 0.25s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Content wrapper */
  .custom-popup-content {
    padding: 1.5rem 1.5rem 0 1.5rem;
    flex-grow: 1;
    text-align: center;
  }

  /* Image container */
  .custom-popup-image-container {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem auto;
  }
  .custom-popup-image-container svg {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto;
  }

  /* Message text */
  .custom-popup-message {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    color: #333;
  }

  /* Buttons container */
  .custom-popup-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid #eee;
  }
  /* Button styles */
  .custom-popup-button {
    min-width: 90px;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  .custom-popup-button.confirm {
    background-color: #28a745;
    color: white;
  }
  .custom-popup-button.confirm:hover {
    background-color: #218838;
  }
  .custom-popup-button.cancel {
    background-color: #dc3545;
    color: white;
  }
  .custom-popup-button.cancel:hover {
    background-color: #c82333;
  }

  /* Responsive tweaks */
  @media (max-width: 768px) {
    .custom-popup-box {
      max-width: 320px;
    }
  }
  @media (max-width: 480px) {
    .custom-popup-box {
      max-width: 280px;
    }
    .custom-popup-button {
      min-width: 70px;
      padding: 0.4rem 0.8rem;
      font-size: 0.9rem;
    }
  }