body {
  top: 0;
  bottom: 0;
  position: absolute;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #f0f0f0;
}

button {
  text-align: center;
  padding: .5rem;
  background-color: #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(237, 237, 237, 1);
  border-radius: 4px 4px 4px 4px;
}

button:hover {background-color: #f8f8f8}

button:active {
  background-color: #eee;
  box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.08);
  transform: translateY(1px);
}

/* Menu */

header {
  position: fixed;
  z-index: 998;
}

#toggle-sidebar {
  position: fixed;
  left: 0;
  top: 10px;
  border-radius: 0 4px 4px 0;
  width: 35px;
  padding: .25rem .5rem;
  font-size: .875rem;
  line-height: 1.5;
  border-left: 1px solid white;
  z-index: 1000;
}

header.toggled #toggle-sidebar {
  left: 260px;
}

#sidebar {
  width: 260px;
  height: 100%;
  max-height: 100%;
  position: fixed;
  top: 0;
  left: -300px;
  z-index: 999;
  background-color: white;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, .15);
}

header.toggled #sidebar {
  left: 0px;
}

.nav-item {
  display: inline-block;
  width: calc(100% - 50px);
  color: black;
  text-decoration: none;
  position: relative;
  padding: 8px 30px 8px 20px;
}

.nav-item:hover {
  background-color: rgba(160, 160, 160, 0.2);
}

.nav-item:focus,
.router-link-exact-active {
  background-color: rgba(0, 0, 0, 0.175);
}

button.nav-item {
  margin: 8px auto;
}

.navBottom {
  position: absolute;
  display: flex;
  flex-direction: column;
  left: 0;
  right: 0;
  bottom: 0;
}

/* UI */
.UI {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  overflow: hidden;
  pointer-events: none;
}

.UI * {
  pointer-events: all;
}

#UI>.syncStatus {
  position: absolute;
  top: 20px;
  right: 20px;
  max-width: 350px;
  max-height: 200px;
  border-radius: 8px;
  padding: 8px;
  background-color: black;
  color: white;
  display: none;
  text-overflow: ellipsis;
  overflow: hidden;
  pointer-events: none;
}

.UI .bottomActions {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 0);
  height: 80px;
  margin: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  grid-gap: 8px;
}

#UI .bottomActions button {
  width: 40px;
  height: 40px;
}

#UI .bottomRightActions {
  position: absolute;
  bottom: 0;
  right: 20px;
  height: 80px;
  margin: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  grid-gap: 8px;
}

#UI .bottomRightActions button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* Content */

.container {
  position: relative;
  height: calc(100% - 100px);
  width: 100%;
  padding-bottom: 100px;
  justify-content: stretch;
  align-content: stretch;
  display: grid;
  grid-template-columns: auto auto auto auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 8px;
  justify-items: center;
  align-items: center;
  z-index: 0;
}

.empty {
  grid-column-start: 1;
  grid-column-end: -1;
  grid-row-start: 1;
  grid-row-end: -1;
}

.error {
  grid-column-start: 1;
  grid-column-end: -1;
  grid-row-start: 1;
  grid-row-end: -1;
}

.loading {
  grid-column-start: 1;
  grid-column-end: -1;
  grid-row-start: 1;
  grid-row-end: -1;
  z-index: 990;
}

.item {
  width: 24vmin;
  height: 24vmin;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 0.125rem 0.25rem rgb(0 0 0 / 8%);
}

.item:hover {
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.item div.imgContainer {
  position: relative;
  height: calc(80% - 16px);
  /* 65% - (8px * 2) padding */
  padding: 8px;
  user-select: none;
}

.item div.imgContainer * {
  max-width: 100%;
  max-height: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
}

.item div.label {
  height: 20%;
  padding: auto 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}


.item div.label>* {
  vertical-align: middle;
}

@media screen and (max-width: 800px) {
  .container {
    grid-template-columns: auto auto;
    grid-template-rows: auto auto auto auto;
  }

  .item {
    width: 20vmax;
    height: 20vmax;
  }

  .item div.imgContainer {
    height: calc(75% - 16px);
    /* 65% - (8px * 2) padding */
  }

  .item div.label {
    height: 25%;
  }
}

@media screen and (max-width: 800px) and (orientation: landscape) {
  .container {
    grid-template-columns: auto auto auto auto;
    grid-template-rows: auto auto;
  }

  .item {
    width: 24vmin;
    height: 24vmin;
  }

  .item div.imgContainer {
    height: calc(65% - 16px);
    /* 65% - (8px * 2) padding */
  }

  .item div.label {
    height: 35%;
  }
}