.notice-popup-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: var(--rg-space-2xl);
  background: var(--rg-color-overlay);
  box-sizing: border-box;
}

.notice-popup-layer[hidden],
.notice-popup[hidden] {
  display: none;
}

.notice-popup {
  width: min(100%, 520px);
  max-height: calc(100vh - 2 * var(--rg-space-2xl));
  overflow-y: auto;
  padding: var(--rg-space-3xl);
  border: 1px solid #e4e4e4;
  border-radius: 14px;
  background: var(--rg-color-surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  box-sizing: border-box;
}

.notice-popup__content > h2 {
  margin: 0;
  text-align: center;
  color: #111;
  font-size: var(--rg-font-size-dialog-title);
  font-weight: var(--rg-font-weight-extrabold);
  line-height: 1.35;
}

.notice-popup__content p {
  margin: var(--rg-space-lg) 0 0;
  color: #4b4b4b;
  font-size: var(--rg-font-size-body);
  line-height: 1.6;
}

.notice-popup__body {
  position: relative;
  max-height: 360px;
  margin-top: var(--rg-space-lg);
  overflow: hidden;
}

.notice-popup__body::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--rg-color-surface));
  content: "";
  pointer-events: none;
}

.notice-popup__body h2 {
  margin: var(--rg-space-xl) 0 var(--rg-space-sm);
  color: var(--rg-color-text-default);
  font-size: var(--rg-font-size-body-md);
  font-weight: var(--rg-font-weight-semibold);
  line-height: 1.5;
}

.notice-popup__body p {
  margin: var(--rg-space-md) 0 0;
}

.notice-popup__body .notice-body-center {
  text-align: center;
}

.notice-popup__image-link,
.notice-popup__image-link img {
  display: block;
  width: 100%;
}

.notice-popup__image-link img {
  height: auto;
  border-radius: 8px;
}

.notice-popup__dismiss-option {
  display: inline-flex;
  min-height: var(--rg-control-height-sm);
  align-items: center;
  gap: var(--rg-space-md);
  margin-top: var(--rg-space-lg);
  color: #333;
  font-size: var(--rg-font-size-body-sm);
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}

.notice-popup__dismiss-option input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--rg-color-brand-primary);
  cursor: pointer;
}

.notice-popup__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--rg-space-md);
  margin-top: var(--rg-space-md);
}

.notice-popup__close,
.notice-popup__detail {
  min-height: var(--rg-control-height-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--rg-space-md) var(--rg-space-lg);
  border-radius: 8px;
  box-sizing: border-box;
  font: inherit;
  font-weight: var(--rg-font-weight-semibold);
  text-decoration: none;
  cursor: pointer;
}

.notice-popup__close {
  border: 1px solid #cfcfcf;
  background: var(--rg-color-surface);
  color: #333;
}

.notice-popup__detail {
  border: 1px solid var(--rg-color-brand-primary);
  background: var(--rg-color-brand-primary);
  color: var(--rg-color-text-inverse);
}

.notice-popup__close:focus-visible,
.notice-popup__image-link:focus-visible,
.notice-popup__dismiss-option input:focus-visible {
  outline: 3px solid var(--rg-color-focus);
  outline-offset: 3px;
}

.notice-popup__detail:focus-visible {
  outline: 3px solid var(--rg-color-focus-on-brand);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .notice-popup-layer {
    padding: var(--rg-layout-gutter-mobile);
    overflow-y: auto;
  }

  .notice-popup {
    max-height: calc(100vh - 2 * var(--rg-layout-gutter-mobile));
    max-height: calc(100dvh - 2 * var(--rg-layout-gutter-mobile));
    margin: 0;
    padding: var(--rg-space-2xl) var(--rg-space-xl);
  }

  .notice-popup__body {
    max-height: 220px;
  }
}
