.announcement-popup-open { overflow: hidden; }

.announcement-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 18, 36, 0.78);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.announcement-popup.is-open { opacity: 1; }

.announcement-popup-dialog {
  position: relative;
  width: min(92vw, 640px);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: visible;
  background: #ffffff;
  border: 8px solid #ffffff;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  transform: translateY(14px) scale(0.98);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.announcement-popup.is-open .announcement-popup-dialog { transform: translateY(0) scale(1); }

.announcement-popup-image-link {
  display: block;
  overflow: hidden;
  background: #f4f8f5;
  border-radius: 16px 16px 0 0;
}

.announcement-popup-image {
  display: block;
  width: 100%;
  max-height: calc(100vh - 132px);
  max-height: calc(100dvh - 132px);
  object-fit: contain;
}

.announcement-popup-close {
  position: absolute;
  top: -25px;
  right: -25px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  color: #0b1f3a;
  background: #ffffff;
  border: 3px solid #e85d04;
  border-radius: 50%;
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.announcement-popup-close svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.announcement-popup-close:hover { color: #ffffff; background: #e85d04; }
.announcement-popup-close:focus-visible { outline: 4px solid rgba(255, 179, 125, 0.72); outline-offset: 3px; }

.announcement-popup-preference {
  display: flex;
  justify-content: flex-start;
  min-height: 54px;
  padding: 10px 12px;
  color: #17362c;
  background: #ffffff;
  border-radius: 0 0 16px 16px;
}

.announcement-popup-preference label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.announcement-popup-preference input {
  width: 21px;
  height: 21px;
  margin: 0;
  accent-color: #087b55;
  cursor: pointer;
}

.announcement-popup-preference input:focus-visible { outline: 3px solid rgba(8, 123, 85, 0.3); outline-offset: 3px; }

@media (max-width: 540px) {
  .announcement-popup { align-items: center; padding: 14px; }
  .announcement-popup-dialog { width: min(100%, 430px); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); border-width: 5px; border-radius: 18px; }
  .announcement-popup-image { max-height: calc(100vh - 102px); max-height: calc(100dvh - 102px); }
  .announcement-popup-image-link { border-radius: 13px 13px 0 0; }
  .announcement-popup-close { top: 8px; right: 8px; width: 46px; height: 46px; border-width: 2px; }
  .announcement-popup-preference { min-height: 50px; padding: 8px 10px; border-radius: 0 0 13px 13px; }
  .announcement-popup-preference label { font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .announcement-popup,
  .announcement-popup-dialog { transition: none; }
}
