.pm-gallery-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  flex: 1 1 auto;
}
.pm-gallery-frame .pm-swipe {
  touch-action: pan-y pinch-zoom;
}
.ml-root .ml-viewer.pm-image-viewer,
.wt-download-center .wt-media-viewer.pm-image-viewer {
  box-sizing: border-box;
  width: min(1120px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  height: min(920px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
}
.pm-image-viewer .pm-gallery-frame {
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
.pm-image-viewer .pm-gallery-frame > :is(.ml-stage, .wt-md-stage) {
  min-height: 0;
  max-height: none;
  padding: 4px 16px;
  overflow: hidden;
}
.pm-image-viewer .pm-gallery-frame > :is(.ml-stage, .wt-md-stage) img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  user-select: none;
}
.pm-image-viewer .pm-gallery-frame button.pm-arrow {
  position: absolute;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  color: #172633;
  background: #fff;
  box-shadow: 0 2px 8px #1726331a;
  cursor: pointer;
}
.pm-gallery-frame .pm-arrow svg {
  display: block;
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}
.pm-image-viewer .pm-gallery-frame button.pm-arrow:is(:hover, :focus-visible) {
  color: #a7410d;
  border-color: currentColor;
  background: #fff6f0;
}
.pm-gallery-frame .pm-prev { left: 8px; }
.pm-gallery-frame .pm-next { right: 8px; }
@media (max-width: 600px) {
  .ml-root .ml-viewer.pm-image-viewer,
  .wt-download-center .wt-media-viewer.pm-image-viewer {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
  }
  .pm-image-viewer .pm-gallery-frame > :is(.ml-stage, .wt-md-stage) { padding-inline: 6px; }
  .pm-gallery-frame .pm-prev { left: 3px; }
  .pm-gallery-frame .pm-next { right: 3px; }
}
.pm-gallery-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-top: 1px solid #dbe2e7;
  min-width: 0;
}
.pm-gallery-strip {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 6px;
  padding: 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.pm-gallery-strip button {
  flex: 0 0 clamp(46px, 10vw, 60px);
  height: clamp(46px, 10vw, 60px);
  padding: 2px;
  border: 2px solid #dbe2e7;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
}
.pm-gallery-strip img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pm-gallery-strip button[aria-current] { border-color: #a7410d; }
.pm-gallery-count { white-space: nowrap; font-size: .8rem; font-variant-numeric: tabular-nums; }
.pm-gallery-footer[hidden], .pm-image-viewer .pm-gallery-frame button.pm-arrow[hidden] { display: none; }
.ml-root .ml-viewer[open] {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.ml-root .ml-viewer .pm-gallery-frame { grid-row: 3; }
.ml-root .ml-viewer .pm-gallery-footer { grid-row: 4; }
.ml-preview-models { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
.ml-preview-models-label { font-weight: 650; }
.ml-preview-model-chip { padding: 3px 6px; background: #f1f5f9; border-radius: 4px; }
.pm-model-cover {
  grid-column: 1 / -1;
  height: clamp(100px, 18vw, 160px);
  aspect-ratio: auto;
  overflow: hidden;
  border: 1px solid #dbe2e7;
  border-radius: 7px;
}
.pm-model-cover video { width: 100%; height: 100%; object-fit: contain; }
#dlc .ml-root .ml-file:has(> .pm-download-icon),
.wt-download-center .wt-md-file:has(> .pm-download-icon) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  grid-template-rows: auto auto;
  align-content: start;
  align-items: start;
  column-gap: 8px;
}
#dlc .ml-root .ml-file:has(> .pm-download-icon) {
  grid-template-columns: minmax(0, 1fr) 52px;
  padding-bottom: 8px;
}
#dlc .ml-root .ml-file > .ml-thumb,
.wt-download-center .wt-md-file > .wt-md-thumb {
  grid-column: 1 / -1;
  grid-row: 1;
}
#dlc .ml-root .ml-file > .ml-file-label,
.wt-download-center .wt-md-file > .wt-md-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
#dlc .ml-root .ml-file > .pm-download-icon,
.wt-download-center .wt-md-file > .pm-download-icon {
  align-self: start;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
}
#dlc .ml-root .ml-file > .pm-download-icon { margin-top: 4px; }
@media (max-width: 600px) {
  #dlc .ml-root .ml-file:has(> .pm-download-icon) { padding-bottom: 0; }
  #dlc .ml-root .ml-file > .ml-file-label,
  .wt-download-center .wt-md-file > .wt-md-label { grid-column: 1 / -1; }
  #dlc .ml-root .ml-file > .pm-download-icon,
  .wt-download-center .wt-md-file > .pm-download-icon {
    grid-area: 1 / 1 / 2 / -1;
    z-index: 1;
    place-self: end;
    margin: 0 8px 8px;
  }
}
#dlc .ml-root .ml-dialog-foot > button.ml-primary,
.wt-download-center .wt-md-foot > button.wt-md-bulk {
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 18px;
  line-height: 1.35;
}
.pm-download-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
