html:has(.ym-viewer[open]) { overflow: hidden; }

.ym-viewer {
  box-sizing: border-box;
  width: min(88vw, 960px);
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid #424242;
  color: #fafafa;
  background: #121212;
  font: 400 14px/1.4 Inter, Arial, sans-serif;
  overscroll-behavior: contain;
}
.ym-viewer::backdrop { background: rgb(5 5 5 / 91%); }
.ym-viewer button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #676767;
  border-radius: 50%;
  color: inherit;
  background: #151515;
  font: 400 24px/1 Arial, sans-serif;
  cursor: pointer;
}
.ym-viewer button:hover { color: #111; background: #fff; }
.ym-viewer button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ym-viewer__close { position: absolute; z-index: 1; top: 10px; right: 10px; }
.ym-viewer__stage { display: grid; place-items: center; background: #080808; }
.ym-viewer__stage :is(img, video) {
  display: block;
  width: 100%;
  height: min(72vh, 760px);
  height: min(72dvh, 760px);
  object-fit: contain;
}
.ym-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 12px;
  padding: 10px 16px;
}
.ym-viewer__nav { display: flex; gap: 8px; }
.ym-viewer__nav[hidden] { display: none; }
@media (max-width: 600px) {
  .ym-viewer { width: calc(100% - 24px); }
  .ym-viewer__bar { padding-inline: 12px; }
}
@media (max-height: 450px) {
  .ym-viewer__stage :is(img, video) { height: calc(100dvh - 96px); }
}
