.photo-viewer-window {
  left: clamp(112px, 13vw, 292px);
  top: clamp(62px, 9vh, 124px);
  width: min(980px, 78vw);
  height: min(680px, calc(100vh - var(--taskbar-h) - 70px));
  min-width: 700px;
  min-height: 500px;
  z-index: 9;
}

.photo-viewer-window.is-active {
  z-index: 13;
}

.photo-viewer-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto 23px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  color: #1b2f42;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(220, 235, 248, .84) 78px, #f5f8fb 79px),
    #f5f8fb;
  border-top: 1px solid rgba(255, 255, 255, .72);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 12px;
}

.photo-viewer-menubar,
.photo-viewer-toolbar,
.photo-viewer-controlbar,
.photo-viewer-statusbar {
  min-width: 0;
}

.photo-viewer-menubar {
  display: flex;
  align-items: center;
  gap: 1px;
  min-height: 24px;
  padding: 2px 7px;
  background:
    linear-gradient(#ffffff, #edf4fb 48%, #dce9f4),
    #edf4fb;
  border-bottom: 1px solid #bdcedf;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .94);
}

.photo-viewer-menubar button,
.photo-viewer-toolbar button {
  position: relative;
  min-height: 21px;
  padding: 2px 8px 3px;
  color: #20384e;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  font: inherit;
}

.photo-viewer-menu-button--split {
  padding-right: 19px;
}

.photo-viewer-menu-button--split::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid #36566d;
  transform: translateY(-35%);
}

.photo-viewer-menubar button:hover,
.photo-viewer-menubar button:focus-visible,
.photo-viewer-toolbar button:hover,
.photo-viewer-toolbar button:focus-visible {
  border-color: #8db7d6;
  background: linear-gradient(#ffffff, #e3f3fd 48%, #c6e3f5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .76);
  outline: 0;
}

.photo-viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 34px;
  padding: 4px 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(215, 231, 245, .86)),
    #dfeaf5;
  border-bottom: 1px solid #b5c9db;
}

.photo-viewer-toolbar-spacer {
  flex: 1 1 auto;
}

.photo-viewer-toolbar-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.photo-viewer-workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, .88), transparent 27%),
    linear-gradient(#eef3f8, #d8e4ef);
}

.photo-viewer-stage {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 12px 8px 8px;
}

.photo-viewer-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.photo-viewer-image-mat {
  --photo-viewer-zoom: 1;
  --photo-viewer-rotation: 0deg;
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  border: 1px solid #aebdca;
  background:
    linear-gradient(45deg, rgba(210, 220, 229, .32) 25%, transparent 25% 75%, rgba(210, 220, 229, .32) 75%) 0 0 / 28px 28px,
    linear-gradient(45deg, rgba(210, 220, 229, .32) 25%, transparent 25% 75%, rgba(210, 220, 229, .32) 75%) 14px 14px / 28px 28px,
    #f9fbfd;
  box-shadow:
    inset 0 1px 2px rgba(29, 58, 84, .18),
    0 1px 0 rgba(255, 255, 255, .86);
}

.photo-viewer-image-mat::before,
.photo-viewer-image-mat::after {
  pointer-events: none;
  position: absolute;
  z-index: 1;
  opacity: 0;
}

.photo-viewer-image-mat::before {
  content: "";
  width: 34px;
  height: 34px;
  border: 3px solid rgba(76, 139, 181, .28);
  border-top-color: #348bc5;
  border-radius: 50%;
  animation: photo-viewer-spin 820ms linear infinite;
}

.photo-viewer-image-mat::after {
  content: attr(data-photo-viewer-message);
  max-width: min(340px, calc(100% - 32px));
  padding: 8px 12px;
  color: #24445e;
  text-align: center;
  border: 1px solid #a9bfd0;
  border-radius: 3px;
  background: linear-gradient(#ffffff, #e9f3fa);
  box-shadow: 0 2px 8px rgba(35, 62, 85, .16);
}

.photo-viewer-image-mat.is-loading::before,
.photo-viewer-image-mat.is-error::after {
  opacity: 1;
}

.photo-viewer-image-mat.is-loading img {
  opacity: .42;
}

.photo-viewer-image-mat.is-error img {
  opacity: .18;
}

.photo-viewer-image-mat img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid rgba(80, 102, 121, .46);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(32, 58, 82, .24);
  transform: rotate(var(--photo-viewer-rotation)) scale(var(--photo-viewer-zoom));
  transform-origin: center;
  transition: transform 140ms ease;
}

@keyframes photo-viewer-spin {
  to {
    transform: rotate(360deg);
  }
}

.photo-viewer-image-mat[data-photo-viewer-mode="actual"] {
  place-items: start center;
}

.photo-viewer-image-mat[data-photo-viewer-mode="actual"] img {
  max-width: none;
  max-height: none;
}

.photo-viewer-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 31px;
  padding: 5px 8px 0;
  color: #344c61;
}

.photo-viewer-caption strong,
.photo-viewer-caption span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-viewer-caption strong {
  color: #173c5c;
  font-size: 13px;
  font-weight: 600;
}

.photo-viewer-caption span {
  color: #63798c;
  font-size: 11px;
}

.photo-viewer-side-button {
  align-self: center;
  justify-self: center;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 72px;
  padding: 0;
  color: #22516f;
  border: 1px solid #93b7d2;
  border-radius: 4px;
  background:
    linear-gradient(#ffffff, #dceffa 48%, #b7d7ec),
    #dceffa;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .74),
    0 1px 2px rgba(37, 65, 89, .2);
}

.photo-viewer-side-button:hover,
.photo-viewer-side-button:focus-visible,
.photo-viewer-control:hover,
.photo-viewer-control:focus-visible {
  color: #11334f;
  border-color: #4f98c6;
  background:
    linear-gradient(#ffffff, #e8f7ff 48%, #78bee5),
    #bde6f8;
  outline: 0;
}

.photo-viewer-side-button:active,
.photo-viewer-control:active,
.photo-viewer-control.is-active {
  background:
    linear-gradient(#73b7dd, #a8d8ef 52%, #effbff),
    #91cce8;
}

.photo-viewer-filmstrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 6px;
  min-width: 0;
  max-height: 102px;
  overflow: hidden auto;
  padding: 7px 9px 9px;
  background:
    linear-gradient(#f8fbfe, #e0ecf6),
    #e9f2fa;
  border-top: 1px solid #bfcede;
}

.photo-viewer-thumb {
  display: grid;
  grid-template-rows: 46px auto;
  gap: 3px;
  min-width: 0;
  min-height: 72px;
  padding: 4px;
  color: #20384e;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  font: inherit;
}

.photo-viewer-thumb:hover,
.photo-viewer-thumb:focus-visible {
  border-color: #a7c9e2;
  background: linear-gradient(#ffffff, #e4f4ff);
  outline: 0;
}

.photo-viewer-thumb.is-current {
  border-color: #5d9dcb;
  background: linear-gradient(#dff3ff, #b7def6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .76);
}

.photo-viewer-thumb img {
  display: block;
  width: 100%;
  height: 46px;
  object-fit: cover;
  border: 1px solid #a9bdcd;
  background: #ffffff;
}

.photo-viewer-thumb span {
  min-width: 0;
  overflow: hidden;
  color: #233d54;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-viewer-controlbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 51px;
  padding: 7px 9px;
  overflow: hidden;
  background:
    linear-gradient(#fdfefe, #dbe8f3 62%, #cadcea),
    #dbe8f3;
  border-top: 1px solid #b2c6d8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .92);
}

.photo-viewer-control {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 30px;
  padding: 0;
  color: #1f4b68;
  border: 1px solid #81a9c6;
  border-radius: 4px;
  background:
    linear-gradient(#ffffff, #d9ecf8 48%, #a9d0e8 49%, #73afd4),
    #c5e0f1;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .74),
    0 1px 2px rgba(43, 75, 103, .24);
}

.photo-viewer-control--primary {
  width: 42px;
  height: 36px;
  border-radius: 50%;
}

.photo-viewer-control--text {
  color: #1b4663;
  font-size: 11px;
  font-weight: 700;
}

.photo-viewer-control-separator {
  flex: 0 0 1px;
  width: 1px;
  height: 28px;
  margin: 0 4px;
  background: #aebfd0;
  box-shadow: 1px 0 0 rgba(255, 255, 255, .86);
}

.photo-viewer-zoom-field {
  display: grid;
  align-items: center;
  flex: 0 1 130px;
  min-width: 82px;
  max-width: 140px;
}

.photo-viewer-zoom-field input {
  width: 100%;
  min-width: 0;
  accent-color: #3d91c8;
}

.photo-viewer-zoom-field input::-webkit-slider-runnable-track {
  height: 7px;
  border: 1px solid #8da9bc;
  border-radius: 999px;
  background: linear-gradient(#e7eef5, #ffffff);
  box-shadow: inset 0 1px 2px rgba(37, 65, 87, .22);
}

.photo-viewer-zoom-field input::-moz-range-track {
  height: 7px;
  border: 1px solid #8da9bc;
  border-radius: 999px;
  background: linear-gradient(#e7eef5, #ffffff);
  box-shadow: inset 0 1px 2px rgba(37, 65, 87, .22);
}

.photo-viewer-zoom-field input::-webkit-slider-thumb {
  width: 14px;
  height: 18px;
  margin-top: -6px;
  border: 1px solid #5a89ad;
  border-radius: 3px;
  background: linear-gradient(#ffffff, #b5dcf4 55%, #6aaed8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}

.photo-viewer-zoom-field input::-moz-range-thumb {
  width: 14px;
  height: 18px;
  border: 1px solid #5a89ad;
  border-radius: 3px;
  background: linear-gradient(#ffffff, #b5dcf4 55%, #6aaed8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}

.photo-viewer-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 9px;
  color: #3a5368;
  background: linear-gradient(#f7fbff, #dce9f5);
  border-top: 1px solid #b8ccdd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
}

.photo-viewer-statusbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-viewer-glyph {
  position: relative;
  display: inline-block;
  color: currentColor;
}

.photo-viewer-glyph--prev,
.photo-viewer-glyph--next {
  width: 16px;
  height: 16px;
}

.photo-viewer-glyph--prev::before,
.photo-viewer-glyph--next::before {
  content: "";
  position: absolute;
  top: 0;
  width: 3px;
  height: 16px;
  background: currentColor;
}

.photo-viewer-glyph--prev::before {
  left: 1px;
}

.photo-viewer-glyph--next::before {
  right: 1px;
}

.photo-viewer-glyph--prev::after,
.photo-viewer-glyph--next::after,
.photo-viewer-glyph--play::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.photo-viewer-glyph--prev::after {
  left: 4px;
  border-right: 12px solid currentColor;
}

.photo-viewer-glyph--next::after {
  right: 4px;
  border-left: 12px solid currentColor;
}

.photo-viewer-glyph--play {
  width: 18px;
  height: 18px;
}

.photo-viewer-glyph--play::after {
  left: 4px;
  top: 1px;
  border-top-width: 8px;
  border-bottom-width: 8px;
  border-left: 13px solid currentColor;
}

.photo-viewer-shell.is-slideshow .photo-viewer-glyph--play::before,
.photo-viewer-shell.is-slideshow .photo-viewer-glyph--play::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 5px;
  height: 14px;
  border: 0;
  background: currentColor;
}

.photo-viewer-shell.is-slideshow .photo-viewer-glyph--play::before {
  left: 3px;
}

.photo-viewer-shell.is-slideshow .photo-viewer-glyph--play::after {
  left: 10px;
}

.photo-viewer-glyph--slideshow {
  width: 19px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
}

.photo-viewer-glyph--slideshow::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
}

.photo-viewer-glyph--zoom-in,
.photo-viewer-glyph--zoom-out {
  width: 17px;
  height: 17px;
}

.photo-viewer-glyph--zoom-in::before,
.photo-viewer-glyph--zoom-out::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.photo-viewer-glyph--zoom-in::after,
.photo-viewer-glyph--zoom-out::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 8px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: center;
}

.photo-viewer-glyph--zoom-in {
  background:
    linear-gradient(currentColor, currentColor) 5px 6px / 6px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 7px 4px / 2px 6px no-repeat;
}

.photo-viewer-glyph--zoom-out {
  background: linear-gradient(currentColor, currentColor) 5px 6px / 6px 2px no-repeat;
}

.photo-viewer-glyph--fit {
  width: 18px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.photo-viewer-glyph--fit::before,
.photo-viewer-glyph--fit::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-color: currentColor;
}

.photo-viewer-glyph--fit::before {
  left: 2px;
  top: 2px;
  border-left: 2px solid;
  border-top: 2px solid;
}

.photo-viewer-glyph--fit::after {
  right: 2px;
  bottom: 2px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.photo-viewer-glyph--rotate-left,
.photo-viewer-glyph--rotate-right {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.photo-viewer-glyph--rotate-left::before,
.photo-viewer-glyph--rotate-right::before {
  content: "";
  position: absolute;
  top: -3px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.photo-viewer-glyph--rotate-left::before {
  left: 0;
  border-right: 7px solid currentColor;
}

.photo-viewer-glyph--rotate-right::before {
  right: 0;
  border-left: 7px solid currentColor;
}

.photo-viewer-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .photo-viewer-image-mat::before {
    animation: none;
  }

  .photo-viewer-image-mat img {
    transition: none;
  }
}

@media (max-width: 899px), (max-height: 690px) {
  .photo-viewer-window {
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: calc(100vw - 16px);
    min-width: 0;
    height: min(84vh, 720px);
  }

  .photo-viewer-shell {
    min-height: 560px;
  }

  .photo-viewer-stage {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    padding: 9px 6px 7px;
  }

  .photo-viewer-side-button {
    width: 28px;
    height: 58px;
  }

  .photo-viewer-image-mat {
    padding: 10px;
  }
}

@media (max-width: 680px) {
  .photo-viewer-menubar,
  .photo-viewer-toolbar {
    flex-wrap: wrap;
    overflow: hidden;
  }

  .photo-viewer-toolbar {
    min-height: 31px;
    padding: 4px 6px;
  }

  .photo-viewer-toolbar button:nth-child(3) {
    display: none;
  }

  .photo-viewer-stage {
    grid-template-columns: 1fr;
  }

  .photo-viewer-side-button {
    display: none;
  }

  .photo-viewer-caption {
    justify-content: flex-start;
  }

  .photo-viewer-controlbar {
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow: hidden;
  }

  .photo-viewer-zoom-field {
    flex-basis: 96px;
  }

  .photo-viewer-image-mat[data-photo-viewer-mode="actual"] {
    place-items: center;
  }

  .photo-viewer-image-mat[data-photo-viewer-mode="actual"] img {
    max-width: 100%;
    max-height: 100%;
  }
}

@media (max-width: 460px) {
  .photo-viewer-window {
    width: calc(100vw - 10px);
  }

  .photo-viewer-shell {
    min-height: 520px;
  }

  .photo-viewer-menubar button,
  .photo-viewer-toolbar button {
    padding-left: 6px;
    padding-right: 6px;
  }

  .photo-viewer-filmstrip {
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  }

  .photo-viewer-thumb {
    grid-template-rows: 40px auto;
  }

  .photo-viewer-thumb img {
    height: 40px;
  }

  .photo-viewer-statusbar span:last-child {
    display: none;
  }
}
