.popup {
  --popup-bg: rgba(19, 23, 21, 0.9);
  --popup-fg: #f8f7f2;
  --popup-muted: #cbd5c9;
  --popup-border: rgba(255, 255, 255, 0.1);
  --popup-accent: #a9c88d;
  --popup-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  --popup-gap: 12px;
  --popup-radius: 14px;
  --popup-badge-bg: rgba(255, 255, 255, 0.08);
  --popup-badge-border: rgba(255, 255, 255, 0.18);
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--popup-bg);
  color: var(--popup-fg);
  padding: 14px 16px;
  border-radius: var(--popup-radius);
  box-shadow: var(--popup-shadow);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  pointer-events: none;
}

.popup-loading {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--popup-accent);
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  animation: popup-loading-spin 700ms linear infinite;
  pointer-events: none;
}

.popup.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@keyframes popup-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.popup__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.popup__title {
  font-weight: 600;
  margin-bottom: 6px;
}

.popup__body {
  display: grid;
  gap: var(--popup-gap);
}

.popup__close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--popup-fg);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.popup__close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.popup__hint {
  color: var(--popup-muted);
  margin: 0 0 8px;
}

.popup code {
  color: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  .popup-loading {
    right: 12px;
    bottom: 12px;
  }

  .popup {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
}
