.menu {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: 3;
  font-family: sans-serif;

  .menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4);
    will-change: opacity;
    transition: opacity 0.2s ease-in-out;
  }

  .menu-wrap {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    min-width: 264px;
    width: 40%;
    max-width: 340px;
    background: #fff;
    box-shadow: 3px 0 16px rgba(0, 0, 0, 0.4);
    will-change: transform;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-flow: column;
    transition: transform 0.2s ease-out;

    & > * {
      min-height: min-content;
    }

    ul {
      margin: 0;
      padding: 0;
    }

    li {
      display: block;
      margin: 0;
      padding: 0;
    }
  }

  .menu-item {
    width: 100%;
    height: 48px;
    padding: 0 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    cursor: pointer;

    &:link,
    &:visited {
      color: inherit;
      text-decoration: none;
    }

    &:focus,
    &:hover {
      outline: none;
      background: rgba(0, 0, 0, 0.1);
    }

    .icon {
      width: 24px;
      height: 24px;
      opacity: 0.6;
      margin-right: 16px;
      flex: none;
    }

    .text {
      line-height: 24px;
      margin-right: 32px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .spinner {
      flex: none;
      margin: 0 0 0 auto;
    }

    &.menu-item-file input[type='file'] {
      display: none;
    }

    &.menu-item-input {
      cursor: pointer;

      .input-wrap {
        position: relative;
        white-space: nowrap;
        height: 24px;
        line-height: 24px;
      }

      .placeholder {
        position: absolute;
        left: 0;
        top: 0;
        z-index: 1;
      }

      textarea {
        position: relative;
        z-index: 2;
        width: 100%;
        height: 100%;
        display: block;
        border: none;
        background: none;
        padding: 0;
        margin: 0;
        opacity: 0;
        font: inherit;
        cursor: inherit;
        resize: none;
        overflow: hidden;

        &:focus {
          outline: none;
          opacity: 1;

          & + .placeholder {
            opacity: 0;
            pointer-events: none;
          }
        }
      }
    }
  }
}

.menu.hidden {
  pointer-events: none;

  .menu-overlay {
    opacity: 0;
  }

  .menu-wrap {
    transform: translateX(-110%);
  }
}
