.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10000;
  animation: backdropIn 120ms ease-out;
}

.backdrop[data-ending-style] {
  animation: backdropOut 120ms ease-in;
}

.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-background, #fff);
  color: var(--color-foreground, #1f2328);
  border: 1px solid var(--color-border, #d0d7de);
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  z-index: 10001;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif);
  animation: popupIn 140ms cubic-bezier(0.2, 0, 0, 1.1);
}

.popup[data-ending-style] {
  animation: popupOut 140ms ease-in;
}

.widthSmall   { width: 320px; }
.widthMedium  { width: 480px; }
.widthLarge   { width: 640px; }
.widthXLarge  { width: 800px; }

.heightSmall  { height: 240px; }
.heightAuto   { height: auto; }
.heightLarge  { height: 480px; }
.heightXLarge { height: 640px; }

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--color-border-muted, #d0d7de40);
}

.titleGroup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.subtitle {
  font-size: 13px;
  color: var(--color-foreground-muted, #59636e);
  margin: 0;
  line-height: 1.4;
}

.closeBtn {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--color-foreground-muted, #59636e);
  cursor: pointer;
  padding: 4px;
  margin: -4px -4px 0 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.closeBtn:hover {
  background: var(--color-background-muted, #f6f8fa);
  color: var(--color-foreground, #1f2328);
}

.body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px 20px;
  min-height: 0;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes backdropOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes popupIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes popupOut {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -48%) scale(0.98); }
}
