.genre-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: var(--width);
  height: calc(874 * var(--unit));
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: calc(64 * var(--unit));
  overflow: hidden;
  background: transparent;
  color: #242424;
  pointer-events: auto;
  font: calc(16 * var(--unit))/1.5 "PingFang SC", -apple-system, sans-serif;
}

.genre-dialog::backdrop { background: transparent; }

.genre-dismiss {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: none;
  cursor: pointer;
}

.genre-panel {
  position: absolute;
  inset: auto 0 0;
  height: calc(420 * var(--unit));
  padding: calc(23 * var(--unit)) calc(20 * var(--unit)) 0;
  border-radius: calc(16 * var(--unit)) calc(16 * var(--unit)) 0 0;
  background: #f4f4f4;
  touch-action: none;
}

.genre-handle {
  position: absolute;
  top: calc(8 * var(--unit));
  left: 50%;
  translate: -50% 0;
  width: calc(34 * var(--unit));
  height: calc(4 * var(--unit));
  border-radius: 999px;
  background: #cdcdcd;
}

.genre-panel h2 {
  margin: 0 0 calc(17 * var(--unit));
  font: 600 calc(16 * var(--unit))/calc(24 * var(--unit)) "PingFang SC", -apple-system, sans-serif;
}

.genre-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: calc(16 * var(--unit));
  row-gap: calc(16.5 * var(--unit));
}

.genre-choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(4 * var(--unit));
  padding: 0 calc(22 * var(--unit)) 0 calc(20 * var(--unit));
  height: calc(49 * var(--unit));
  border: 1px solid transparent;
  border-radius: calc(16 * var(--unit));
  background: #fff;
  cursor: pointer;
}

.genre-choice input {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.genre-choice:has(input:checked) { border-color: #a4e4dc; }
.genre-choice:has(input:focus-visible) { outline: 2px solid #158475; outline-offset: 2px; }

.genre-check {
  display: grid;
  place-items: center;
  width: calc(16 * var(--unit));
  height: calc(16 * var(--unit));
  border: 1px solid #cdcdcd;
  border-radius: 50%;
  flex: none;
}

.genre-choice input:checked ~ .genre-check { background: #51c9ba; border-color: #51c9ba; }
.genre-choice input:checked ~ .genre-check::after {
  content: "";
  width: calc(6 * var(--unit));
  height: calc(3 * var(--unit));
  border-left: calc(1.5 * var(--unit)) solid #fff;
  border-bottom: calc(1.5 * var(--unit)) solid #fff;
  rotate: -45deg;
  translate: 0 -12%;
}

.genre-custom {
  background: #ebebeb;
  border-color: #d6d6d6;
  border-style: dashed;
  color: #858585;
  cursor: default;
  font-size: calc(14 * var(--unit));
  white-space: nowrap;
}

.genre-custom small { color: #a4a4a4; font-size: calc(12 * var(--unit)); }
