
#popup {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  background: inherit;
}

#popup:open {
  animation: popup-fade-in 0.6s;
}

#popup:open.closing {
  animation: popup-fade-out 0.6s;
}

#popup:open::backdrop {
  background-color: rgba(255, 254, 232, 0.25);
  backdrop-filter: blur(0.2em);
}

@keyframes popup-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes popup-fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

#popupLeft {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 20em;
}

#popupButtons {
  position: absolute;
  box-sizing: border-box;
  left: 0;
  bottom: 0;
  right: 0;
  height: 3.5em;
  margin: 1em;
  border: 1px solid #000000;
  border-radius: 0.5em;
  padding: 0.75em;
  background: #ffffff;
  box-shadow:   0.25em 0.25em 0.5em rgba(0, 0, 0, 0.6);
  text-align: center;
}

#popupButtons button {
  width: 8em;
  height:2.5em;
}

#popupIndex {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 4.5em;
  right: 0;
  height: auto;
  margin: 1em;
  border: 1px solid #000000;
  border-radius: 0.5em;
  padding: 0.75em;
  background: var(--CyPaper);
  box-shadow:   0.25em 0.25em 0.5em rgba(0, 0, 0, 0.6);
  overflow: auto;
}

#popupIndex a {
  display: block;
  box-sizing: border-box;
  width: 16.4em;
  height: auto;
  padding: 0.5em;
  margin-bottom: 0.5em;
  border: 1px solid var(--CyPaperEdge);
  border-radius: 0.25em;
  overflow: clip;
}

#popupIndex a.selected {
  background:   var(--CySelected);
  color:        var(--CySelectedText);
  border-color: var(--CySelectedEdge);
}

#popupIndex a:hover {
  background:   var(--CyHover);
  color:        var(--CyHoverText);
  border-color: var(--CyHoverEdge);
}

#popupIndex a:active {
  background:   var(--CyActive);
  color:        var(--CyActiveText);
  border-color: var(--CyActiveEdge);
}

#popupIndex img {
  box-sizing: border-box;
  width: 100%;
  border-radius: 0.15em;
}

#popupRight {
  position: fixed;
  top: 0;
  left: 20em;
  bottom: 0;
  right: 0;
}

#popupView {
  position: absolute;
  top: 1em;
  left: 0;
  bottom: 1em;
  right: 1em;
  border: 1px solid #000000;
  border-radius: 0.5em;
  padding: 0.75em;
  background: var(--CyPaper);
  box-shadow:   0.25em 0.25em 0.5em rgba(0, 0, 0, 0.6);
}

#popupView img {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
}