.song-explorer-search-clear-button {
  top: 50%;
  transform: translateY(-50%);
}

.song-explorer-folder-up-button {
  flex: 0 0 60px;
  width: 60px;
  min-width: 60px;
  height: 42px;
  min-height: 42px;
}

.song-explorer-folder-up-button img {
  width: 29px;
  height: 29px;
}

.song-explorer-sort-menu {
  position: relative;
  flex: 0 0 60px;
}

.song-explorer-sort-button {
  --song-explorer-sort-icon-width: 45px;
  --song-explorer-sort-icon-height: 32px;
  --song-explorer-sort-symbol-size: 22px;
  --song-explorer-sort-bpm-size: 12px;
  --song-explorer-sort-arrow-scale: 1.45;
  --song-explorer-sort-category-scale: 1.45;
  width: 60px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #4a4f6e;
  border-radius: 4px;
  background: #2a2d4a;
  color: #fff;
  cursor: pointer;
  padding: 0;
}

.song-explorer-sort-button:hover {
  background: #3a3d5a;
}

.song-explorer-sort-button:active {
  background: #1a1d34;
}

.song-explorer-sort-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.song-explorer-sort-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 22;
  width: min(310px, calc(100vw - 22px));
  max-height: calc(100dvh - 126px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px;
  display: grid;
  gap: 2px;
  border: 1px solid #4a5e86;
  border-radius: 6px;
  background: #1b1d33;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.song-explorer-sort-option {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #f3f6ff;
  padding: 3px 6px;
  cursor: pointer;
  text-align: left;
}

.song-explorer-sort-option:hover {
  border-color: #4a5e86;
  background: #28304b;
}

.song-explorer-sort-option:active {
  background: #171c2f;
}

.song-explorer-sort-option.active {
  border-color: #7fcbff;
  background: #203c5a;
}

.song-explorer-sort-icon {
  width: var(--song-explorer-sort-icon-width, 30px);
  height: var(--song-explorer-sort-icon-height, 22px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #fff;
  font-size: var(--song-explorer-sort-symbol-size, 15px);
  font-weight: 700;
  line-height: 1;
}

.song-explorer-sort-symbol {
  display: block;
  color: #fff;
  font-size: var(--song-explorer-sort-symbol-size, 15px);
  font-weight: 700;
  line-height: 1;
}

.song-explorer-sort-icon.bpm .song-explorer-sort-symbol {
  font-size: var(--song-explorer-sort-bpm-size, 8px);
  letter-spacing: 0;
}

.song-explorer-sort-arrow,
.song-explorer-sort-category {
  display: block;
  flex: 0 0 auto;
  overflow: visible;
}

.song-explorer-sort-arrow {
  transform: scale(var(--song-explorer-sort-arrow-scale, 1));
  transform-origin: center;
}

.song-explorer-sort-category {
  transform: scale(var(--song-explorer-sort-category-scale, 1));
  transform-origin: center;
}

.song-explorer-sort-arrow path,
.song-explorer-sort-category path {
  fill: #fff;
}

.song-explorer-sort-option-label {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-explorer-list-toolbar {
  justify-content: flex-start;
  gap: 8px;
  overflow: visible;
}

.song-explorer-add-menu {
  position: relative;
  margin-left: auto;
  flex: 0 0 auto;
}

.song-explorer-add-button {
  width: 72px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #4a4f6e;
  border-radius: 4px;
  background: #31507b;
  cursor: pointer;
  padding: 0;
}

.song-explorer-add-button:hover {
  background: #42679a;
}

.song-explorer-add-button:active {
  background: #274264;
}

.song-explorer-add-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.song-explorer-add-button span {
  position: relative;
  width: 16px;
  height: 16px;
  display: block;
}

.song-explorer-add-button span::before,
.song-explorer-add-button span::after {
  content: "";
  position: absolute;
  border-radius: 1px;
  background: #fff;
}

.song-explorer-add-button span::before {
  left: 0;
  top: 7px;
  width: 16px;
  height: 2px;
}

.song-explorer-add-button span::after {
  left: 7px;
  top: 0;
  width: 2px;
  height: 16px;
}

.song-explorer-add-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: min(430px, calc(100vw - 22px));
  max-height: var(--playlist-insert-popup-max-height, calc(100dvh - 126px));
  overflow: hidden;
  padding: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  border: 1px solid #4a5e86;
  border-radius: 6px;
  background: #1b1d33;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.playlist-insert-prompt {
  color: #f3f6ff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.playlist-insert-paper {
  position: relative;
  display: block;
  max-height: var(--playlist-insert-paper-max-height, calc(100dvh - 216px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(184, 199, 255, 0.28);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 18px),
    #111420;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 2px 0 rgba(0, 0, 0, 0.28);
}

.playlist-insert-paper::-webkit-scrollbar {
  width: 10px;
}

.playlist-insert-paper::-webkit-scrollbar-track {
  background: rgba(10, 13, 24, 0.72);
}

.playlist-insert-paper::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #40455e;
}

.playlist-insert-start-position {
  min-height: 40px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid rgba(51, 67, 95, 0.55);
  background: rgba(127, 203, 255, 0.06);
}

.playlist-insert-start-button {
  width: 42px;
}

.song-explorer-insert-row {
  grid-template-columns: 28px minmax(0, 1fr) 42px;
  cursor: default;
}

.playlist-insert-popup.inserting .song-explorer-insert-after-button,
.playlist-insert-popup.inserting .playlist-insert-end-button,
.song-explorer-insert-after-button:disabled,
.playlist-insert-end-button:disabled {
  opacity: 0.52;
  cursor: default;
  pointer-events: none;
}

.song-explorer-insert-row.insert-animation-before {
  z-index: 3;
  animation: playlist-insert-before-spread 1.6s ease-in-out both;
}

.song-explorer-insert-row.insert-animation-after {
  z-index: 2;
  animation: playlist-insert-after-spread 1.6s ease-in-out both;
}

.playlist-insert-animation-slot {
  --playlist-insert-animation-row-height: calc(var(--remote-playlist-row-height, 46px) + 12px);
  height: 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(127, 203, 255, 0.18);
  animation: playlist-insert-slot-open 1.6s cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.song-explorer-inserted-row {
  min-height: var(--remote-playlist-row-height, 46px);
  border-top: 1px solid rgba(127, 203, 255, 0.34);
  border-bottom: 1px solid rgba(127, 203, 255, 0.34);
  background: linear-gradient(90deg, rgba(79, 166, 255, 0.22), rgba(49, 80, 123, 0.2));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  animation: playlist-insert-row-enter 1.6s cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.playlist-insert-animation-marker {
  grid-column: 3;
  justify-self: center;
  position: relative;
  width: 22px;
  height: 22px;
  border: 1px solid #7fcbff;
  border-radius: 999px;
  background: rgba(127, 203, 255, 0.18);
  opacity: 0;
  animation: playlist-insert-marker-pop 1.6s ease-in-out both;
}

.playlist-insert-animation-marker::before,
.playlist-insert-animation-marker::after {
  content: "";
  position: absolute;
  border-radius: 1px;
  background: #dce7ff;
}

.playlist-insert-animation-marker::before {
  width: 11px;
  height: 2px;
  transform: translate(5px, 10px);
}

.playlist-insert-animation-marker::after {
  width: 2px;
  height: 11px;
  transform: translate(10px, 5px);
}

.song-explorer-insert-row .tags {
  max-width: min(46vw, 100%);
}

.song-explorer-meta {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  padding-right: 8px;
}

.song-explorer-meta .tags {
  justify-content: flex-start;
  max-width: 100%;
}

.song-explorer-sort-value {
  min-width: 0;
  max-width: 72px;
  box-sizing: border-box;
  padding-right: 3px;
  overflow: hidden;
  color: #dce7ff;
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-explorer-insert-row .playlist-rating-time {
  min-width: 140px;
  grid-template-columns: 22px 64px auto;
}

.playlist-insert-current-remaining {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #dce7ff;
  font-family: Consolas, monospace;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

.playlist-insert-current-remaining img {
  width: 13px;
  height: 13px;
  object-fit: contain;
  transform: translateY(-2px);
}

.song-explorer-insert-after-button {
  grid-column: 3;
  justify-self: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #5d81bc;
  border-radius: 6px;
  background: #31507b;
  color: #fff;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.song-explorer-insert-after-button span {
  position: relative;
  width: 16px;
  height: 16px;
  display: block;
}

.song-explorer-insert-after-button span::before,
.song-explorer-insert-after-button span::after {
  content: "";
  position: absolute;
  border-radius: 1px;
  background: #fff;
}

.song-explorer-insert-after-button span::before {
  left: 0;
  top: 7px;
  width: 16px;
  height: 2px;
}

.song-explorer-insert-after-button span::after {
  left: 7px;
  top: 0;
  width: 2px;
  height: 16px;
}

.song-explorer-insert-after-button::after {
  content: "";
  width: 0;
  height: 0;
  margin-top: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #dce7ff;
}

.playlist-insert-end-button {
  min-height: 52px;
  border: 1px solid #33435f;
  border-radius: 4px;
  background: #20253b;
  color: #f3f6ff;
  cursor: pointer;
  padding: 5px 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.song-explorer-insert-after-button:hover,
.playlist-insert-end-button:hover {
  background: #28304b;
}

.song-explorer-insert-after-button:active,
.playlist-insert-end-button:active {
  background: #171c2f;
}

.song-explorer-row.selected:not(.previewing) {
  background: rgba(100, 181, 255, 0.16);
}

.song-explorer-row.previewing .song-explorer-status-cell::before {
  content: "";
  width: 20px;
  height: 20px;
  background: url("/Images/RemoteControl.png") center / contain no-repeat;
}

.song-explorer-row.previewing .song-explorer-status-icon {
  display: none;
}

@keyframes playlist-insert-slot-open {
  0% {
    height: 0;
    opacity: 0;
  }

  22% {
    height: 0;
    opacity: 1;
  }

  58% {
    height: calc(var(--playlist-insert-animation-row-height) + 8px);
  }

  100% {
    height: var(--playlist-insert-animation-row-height);
    opacity: 1;
  }
}

@keyframes playlist-insert-row-enter {
  0%,
  26% {
    opacity: 0;
    transform: translateY(-18px) scale(0.98);
  }

  60% {
    opacity: 1;
    transform: translateY(2px) scale(1);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes playlist-insert-before-spread {
  0%,
  18% {
    transform: translateY(0);
  }

  46%,
  78% {
    transform: translateY(-5px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes playlist-insert-after-spread {
  0%,
  18% {
    transform: translateY(0);
  }

  46%,
  78% {
    transform: translateY(5px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes playlist-insert-marker-pop {
  0%,
  40% {
    opacity: 0;
    transform: scale(0.75);
  }

  62%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
