.cpb-popup {
  box-sizing: border-box;
  width: min(32rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 2rem;
  border: 0;
  border-radius: var(--wp--custom--border-radius, 12px);
  background: var(--cpb-background, var(--wp--preset--color--base, Canvas));
  color: var(--cpb-text, var(--wp--preset--color--contrast, CanvasText));
  font: inherit;
  box-shadow: 0 16px 56px rgb(0 0 0 / 22%);
  overscroll-behavior: contain;
}
.cpb-popup::backdrop { background: rgb(0 0 0 / 38%); }
.cpb-popup h2 { margin: 0 2rem 1rem 0; color: inherit; overflow-wrap: anywhere; }
.cpb-popup p { margin: 0 0 1.5rem; white-space: pre-line; overflow-wrap: anywhere; }
.cpb-popup .cpb-close {
  position: absolute; top: .5rem; right: .5rem; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: inherit; cursor: pointer;
}
.cpb-close:hover { opacity: .7; }
.cpb-popup :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.cpb-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.cpb-popup .cpb-link {
  box-sizing: border-box; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center;
  background-color: var(--cpb-button, var(--wp--preset--color--primary, revert));
  color: var(--cpb-button-text, revert);
}
.cpb-bottom-right { margin: auto 1rem 1rem auto; }
.cpb-bottom-left { margin: auto auto 1rem 1rem; }
.cpb-top { margin: 1rem auto auto; }
@media (max-width: 480px) {
  .cpb-popup { padding: 1.5rem; }
  .cpb-actions { flex-direction: column; }
  .cpb-actions .cpb-link { width: 100%; }
}

.cpb-popup[open] { animation: cpb-enter 260ms cubic-bezier(.16, 1, .3, 1) both; }
.cpb-popup[open]::backdrop { animation: cpb-backdrop-in 260ms ease-out both; }
.cpb-popup[open].cpb-leaving { animation: cpb-exit 200ms ease-in both; pointer-events: none; }
.cpb-popup[open].cpb-leaving::backdrop { animation: cpb-backdrop-out 200ms ease-in both; }
@keyframes cpb-enter { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes cpb-exit { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes cpb-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cpb-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cpb-popup[open], .cpb-popup[open]::backdrop,
  .cpb-popup[open].cpb-leaving, .cpb-popup[open].cpb-leaving::backdrop { animation: none; }
}

/* Non-modal announcement bar, in normal flow above the site header. */
.cpb-popup.cpb-topbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  width: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 12px 60px 12px 24px;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.cpb-topbar .cpb-content { min-width: 0; }
.cpb-topbar h2 { margin: 0; font-size: 1em; line-height: 1.5; }
.cpb-topbar p { margin: 2px 0 0; font-size: .9em; line-height: 1.5; }
.cpb-topbar .cpb-actions { justify-content: center; }
.cpb-topbar .cpb-close { top: 50%; transform: translateY(-50%); }
.cpb-topbar .cpb-link { border: 1px solid currentColor; }
.cpb-popup .cpb-link:hover { filter: brightness(.94); }
@media (max-width: 480px) {
  .cpb-popup.cpb-topbar { padding: 12px 56px 12px 16px; justify-content: flex-start; }
  .cpb-topbar .cpb-actions { width: 100%; }
}
