.pwa-media-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: rgba(17, 24, 39, 0.98);
  color: #f9fafb;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.pwa-media-viewer__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 8px 0 4px;
  background: #1f2937;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.pwa-media-viewer__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pwa-media-viewer__back:active {
  background: rgba(255, 255, 255, 0.08);
}

.pwa-media-viewer__title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-media-viewer__body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-media-viewer__body--scroll {
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pwa-media-viewer__pdf-pages {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
}

.pwa-media-viewer__pdf-page {
  margin-bottom: 12px;
}

.pwa-media-viewer__pdf-page-label {
  display: block;
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 4px;
}

.pwa-media-viewer__img--page {
  width: 100%;
  max-height: none;
  height: auto;
  display: block;
  border-radius: 4px;
  background: #fff;
}

.pwa-media-viewer__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pwa-media-viewer__frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (min-width: 768px) and (not (display-mode: standalone)) {
  .pwa-media-viewer {
    display: none !important;
  }
}
