/* Mobile-only image viewer; leaves existing desktop gallery unchanged. */
.pm-gallery-viewer[hidden] { display: none !important; }
@media (max-width: 767px) {
  .pm-gallery-viewer {
    position: fixed; inset: 0; z-index: 2147483000;
    background: rgba(0, 0, 0, .94); color: #fff;
    display: flex; flex-direction: column;
    width: 100vw; height: 100vh; height: 100dvh;
    box-sizing: border-box; overflow: hidden;
  }
  .pm-gallery-toolbar {
    flex: none; display: flex; align-items: center; justify-content: space-between;
    padding: max(10px, env(safe-area-inset-top)) 12px 8px;
    min-height: 56px; box-sizing: border-box;
  }
  .pm-gallery-count { color: #e4eaf0; font: 15px/1.4 Arial, sans-serif; }
  .pm-gallery-close {
    appearance: none; border: 1px solid #9baebd; border-radius: 8px;
    background: #1e3544; color: #fff; min-width: 48px; min-height: 44px;
    font: bold 26px/1 Arial, sans-serif; cursor: pointer;
  }
  .pm-gallery-stage {
    flex: 1 1 auto; min-height: 0; min-width: 0; display: flex;
    justify-content: center; align-items: center; padding: 8px 12px;
    box-sizing: border-box; overflow: hidden;
  }
  .pm-gallery-fullimage {
    display: block; max-width: 100%; max-height: 100%;
    width: auto; height: auto; object-fit: contain;
    box-shadow: 0 0 18px rgba(0,0,0,.35);
  }
  .pm-gallery-footer {
    flex: none; display: flex; justify-content: space-between; gap: 12px;
    padding: 8px 12px max(12px, env(safe-area-inset-bottom));
  }
  .pm-gallery-nav {
    color: #fff; background: #264d65; border: 1px solid #8eabba;
    border-radius: 8px; min-height: 44px; min-width: 100px;
    font: 16px Arial, sans-serif; cursor: pointer;
  }
  .pm-gallery-nav:disabled { opacity: .35; }
  body.pm-gallery-lock { overflow: hidden !important; }
}
