.dialog-ad-mask {
  position: fixed;
  inset: 0;
  z-index: 1900;
  padding: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background: rgba(20, 20, 20, 0.9);
  box-sizing: border-box;
}

.dialog-ad-mask.is-open {
  display: flex;
}

.dialog-ad-panel {
  width: 640px;
  max-width: calc(100vw - 48px);
  margin: auto;
}

.dialog-ad-panel[hidden] {
  display: none;
}

.dialog-ad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.dialog-ad-cover {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  background: var(--bg-panel);
}

.dialog-ad-media {
  display: block;
  width: 100%;
  height: 100%;
}

.dialog-ad-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dialog-ad-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
  height: 16px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 14px;
  color: #ffffff;
  background: var(--bg-panel);
  border: 0;
}

.dialog-ad-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 180ms ease, transform 180ms ease;
}

.dialog-ad-close img {
  width: 18px;
  height: 18px;
  display: block;
}

.dialog-ad-close:hover,
.dialog-ad-close:focus-visible {
  opacity: 0.85;
  transform: scale(1.06);
}

.dialog-ad-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.dialog-ad-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dialog-ad-title {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-ad-desc {
  margin: 0;
  color: #7e818b;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

.dialog-ad-cta {
  flex-shrink: 0;
  box-sizing: border-box;
  height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  background: var(--accent);
  border-radius: 999px;
}

.dialog-ad-cta__icon {
  width: 18px;
  height: 18px;
  display: block;
}

.dialog-ad-cta:hover {
  filter: brightness(1.05);
}

@media (max-width: 767px) {
  .dialog-ad-mask {
    padding: 24px;
  }

  .dialog-ad-panel {
    width: 327px;
    max-width: calc(100vw - 48px);
  }

  .dialog-ad-cover {
    height: 204px;
  }

  .dialog-ad-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 16px;
  }

  .dialog-ad-copy {
    display: contents;
  }

  .dialog-ad-title {
    font-size: 14px;
    line-height: 21px;
    white-space: normal;
  }

  .dialog-ad-desc {
    font-size: 11px;
    line-height: 16px;
  }

  .dialog-ad-cta {
    align-self: stretch;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dialog-ad-close {
    transition: none;
  }
}
