:where(*) {
  box-sizing: border-box;
  font-family: unset;
  font-size: 1em;
  margin: 0;
  padding: 0;
}

:where(html, body) {
  height: 100vh;
  line-height: 0;
}
:where(body > .entry-point) {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -25%);
  max-height: 100vh;
  max-width: 100vw;
}
:where(body > .entry-point > *:not(img)) {
  line-height: 1;
}

.mis-auto {
  margin-inline-start: auto;
}
.gap-h {
  width: 1em;
  height: 100%;
}
.gap-v {
  width: 100%;
  height: 1em;
}

#image-viewer {
  & {
    height: 20em;
    width: 30em;
    max-height: 100%;
    max-width: 100%;
    padding: 1em;
  }
  &.image-loaded {
    background-image: linear-gradient(to right, lightgray 1px, transparent 1px), linear-gradient(to bottom, lightgray 1px, transparent 1px);
    background-position: 0.25em 0.25em;
    background-size: 0.5em 0.5em;
    left: 50%;
    line-height: 0;
    padding: unset;
    position: relative;
    transform: translate(-50%, 0);
  }
  & > img {
    margin-inline: auto;
    max-height: min(100vh, 20em);
    max-width: min(100vw, 30em);
    padding: 1em;
  }
}

#edit-button-container {
  & {
    display: flex;
    flex-flow: row wrap;
    gap: 1em;
    padding-inline: 1em;
    justify-content: space-between;
  }
  & > button {
    background-color: white;
    border-radius: 0.5em;
    border: 0.25em solid black;
    cursor: pointer;
    height: 2.5em;
    width: 5em;
    &:hover {
      background-color: #add8e6;
    }
    &:disabled {
      background-color: white;
      border: 0.25em solid lightgray;
      cursor: unset;
    }
  }
  #split-size {
    appearance: textfield;
    border-radius: 0.5em;
    border: 0.25em solid black;
    padding-inline: 0.5em;
    text-align: right;
    width: 5em;
  }
}

#file-picker {
  & {
    background-color: white;
    border-radius: 0.5em;
    border: 0.25em solid black;
    height: 100%;
    width: 100%;
  }
  &.quiet-mode {
    background-color: unset;
    border-radius: unset;
    border: unset;
    height: 100%;
    width: 100%;
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
    & > span {
      display: none;
    }
  }
  &.hover {
    background-color: #add8e6;
  }
  & > span {
    background-color: transparent;
    border-radius: 0.5em;
    pointer-events: none;
    transform: scale(1);
    transition: all 0.2s ease;
  }
  &:hover > span {
    background-color: #add8e6;
    padding-bottom: 0.75em;
    padding-inline: 0.25em;
    padding-top: 0.25em;
    transform: scale(1.14);
    transition: all 0.15s ease;
  }
}

#output-container {
  display: flex;
  flex-flow: column nowrap;
  gap: 1em;

  & > div {
    border-block: 1px solid lightgray;
    max-height: min(100vh, 20em);
    max-width: min(100vw, 30em);
    min-height: 1em;
    overflow: auto;
    & > div {
      height: min-content;
      padding: 1em;
      position: relative;
      width: min-content;
      & > div.delete-output {
        background-color: #d0d0d055;
        cursor: pointer;
        display: flex;
        flex-flow: row nowrap;
        align-items: center;
        justify-content: center;
        font-family: Verdana, Geneva, Tahoma, sans-serif;
        height: 1.5em;
        left: 0.5em;
        position: absolute;
        top: 50%;
        transform: translate(0, -50%);
        user-select: none;
        width: 1.5em;
        &:hover {
          background-color: #add8e6;
        }
      }
      & > pre.error-message {
        margin-left: 2em;
      }
    }
  }

  & > img {
    background-image: linear-gradient(to right, lightgray 1px, transparent 1px), linear-gradient(to bottom, lightgray 1px, transparent 1px);
    background-position: 0.25em 0.25em;
    background-size: 0.5em 0.5em;
    margin-inline: auto;
    max-height: min(100vh, 20em);
    max-width: min(100vw, 30em);
    padding: 1em;
  }
}

.collapse {
  visibility: collapse !important;
}
.hide {
  visibility: hidden !important ;
}
.remove {
  display: none !important;
}
