.mkip-overlay {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; box-sizing: border-box;
  background: rgba(13,18,27,.55);
  -webkit-backdrop-filter: grayscale(50%) blur(3px);
  backdrop-filter: grayscale(50%) blur(3px);
  opacity: 0; transition: opacity .25s ease;
}
.mkip-overlay.mkip-visible { opacity: 1; }
.mkip-dialog {
  position: relative; box-sizing: border-box; width: var(--mkip-width,70vw);
  max-width: calc(100vw - 48px); max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px); display: flex; align-items: center;
  justify-content: center; filter: drop-shadow(0 24px 48px rgba(0,0,0,.25));
  transform: translateY(12px) scale(.985); transition: transform .25s ease;
}
.mkip-visible .mkip-dialog { transform: translateY(0) scale(1); }
.mkip-image {
  display: block; width: 100%; height: auto; max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px); object-fit: contain; border-radius: 12px;
}
.mkip-close {
  appearance: none; -webkit-appearance: none; position: absolute;
  top: 9px; right: 9px; z-index: 2; display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid rgba(255,255,255,.55); border-radius: 50%;
  background: rgba(13,18,27,.76); color: #fff;
  box-shadow: 0 3px 15px rgba(0,0,0,.18); cursor: pointer;
  transition: background .18s, transform .18s;
}
.mkip-close:hover { background: rgba(13,18,27,.95); transform: scale(1.06); }
.mkip-close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.mkip-close svg { width: 19px; height: 19px; }
@media (max-width: 767px) {
  .mkip-overlay { padding: 12px; }
  .mkip-dialog { width: min(var(--mkip-width,70vw), calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .mkip-image { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 9px; }
  .mkip-close { top: 6px; right: 6px; width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .mkip-overlay, .mkip-dialog, .mkip-close { transition: none; } }
